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

[libvirt] [PATCH v2 1/8] qemu: Separate char device removal into a standalone function



---

Notes:
    Version 2:
    - new patch

 src/qemu/qemu_hotplug.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 788ad47..f2dddc8 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -2475,6 +2475,19 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver,
 }
 
 
+static void
+qemuDomainRemoveChrDevice(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
+                          virDomainObjPtr vm,
+                          virDomainChrDefPtr chr)
+{
+    VIR_DEBUG("Removing character device %s from domain %p %s",
+              chr->info.alias, vm, vm->def->name);
+
+    qemuDomainChrRemove(vm->def, chr);
+    virDomainChrDefFree(chr);
+}
+
+
 int qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver,
                                      virDomainObjPtr vm,
                                      virDomainDiskDefPtr detach)
@@ -3172,8 +3185,7 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
     }
     qemuDomainObjExitMonitor(driver, vm);
 
-    qemuDomainChrRemove(vmdef, tmpChr);
-    virDomainChrDefFree(tmpChr);
+    qemuDomainRemoveChrDevice(driver, vm, tmpChr);
     ret = 0;
 
 cleanup:
-- 
1.8.3.2


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