[PATCH 1/4] ch: Actually remove device in chDomainDetachDeviceLive()

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

 



From: Michal Privoznik <mprivozn@xxxxxxxxxx>

Inside of chDomainDetachDeviceLive() there are two variables that
are important in this case: 'match' and 'detach'. The first one
contains device definition as parsed from user provided XML, the
other contains pointer to the device definition inside
virDomainDef (as returned by chDomainFindDisk()).

Now, when chDomainRemoveDevice() is called, it looks up the
device inside virDomainDef and removes it (using pointer
comparison). Well, that means 'detach' must be passed as an
argument instead of 'match'.

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

diff --git a/src/ch/ch_hotplug.c b/src/ch/ch_hotplug.c
index 058954035d..b06fdbe5a8 100644
--- a/src/ch/ch_hotplug.c
+++ b/src/ch/ch_hotplug.c
@@ -336,7 +336,7 @@ chDomainDetachDeviceLive(virDomainObj *vm,
         return -1;
     }
 
-    if (chDomainRemoveDevice(vm, match) < 0)
+    if (chDomainRemoveDevice(vm, &detach) < 0)
         return -1;
 
     if (match->type == VIR_DOMAIN_DEVICE_DISK) {
-- 
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