[PATCH 2/4] ch: Drop deadcode from chDomainDetachDeviceLive()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michal Privoznik <mprivozn@xxxxxxxxxx>

At the end of chDomainDetachDeviceLive() there's a code that
tries to remove the disk that's being detached from the domain
definition. Well, it's a leftover from the original patch which I
forgot to remove when rewriting it to use chDomainRemoveDevice().
The disk is removed there so this code has no chance in removing
it again. Drop the code.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/ch/ch_hotplug.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/src/ch/ch_hotplug.c b/src/ch/ch_hotplug.c
index b06fdbe5a8..aa723dd123 100644
--- a/src/ch/ch_hotplug.c
+++ b/src/ch/ch_hotplug.c
@@ -263,7 +263,6 @@ chDomainDetachDeviceLive(virDomainObj *vm,
     virDomainDeviceDef detach = { .type = match->type };
     virDomainDeviceInfo *info = NULL;
     virCHDomainObjPrivate *priv = vm->privateData;
-    int idx = 0;
 
     switch (match->type) {
     case VIR_DOMAIN_DEVICE_DISK:
@@ -339,13 +338,6 @@ chDomainDetachDeviceLive(virDomainObj *vm,
     if (chDomainRemoveDevice(vm, &detach) < 0)
         return -1;
 
-    if (match->type == VIR_DOMAIN_DEVICE_DISK) {
-        idx = chFindDiskId(vm->def, match->data.disk->dst);
-        if (idx >= 0) {
-            virDomainDiskRemove(vm->def, idx);
-        }
-    }
-
     return 0;
 }
 
-- 
2.49.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux