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

[libvirt] [PATCH/RFC] qemu: persist hotadd devices



Hi,
currently devices added via qemudDomainAttachDevice don't ever get
written out into the xml domain definition. Is this intentional?
Attached patch calls virDomainSaveConfig to fix this.
 -- Guido
>From 42142a2ecb04a26f867d030fb986fcee2b7a05b9 Mon Sep 17 00:00:00 2001
From: Guido Guenther <agx sigxcpu org>
Date: Fri, 17 Oct 2008 09:41:56 +0200
Subject: [PATCH] persist hot added devices

---
 src/qemu_driver.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 381def7..2379ac7 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -2735,6 +2735,9 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
         qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT,
                          "%s", _("this device type cannot be attached"));
         ret = -1;
+    } else if (!ret) {
+        if (virDomainSaveConfig(dom->conn, driver->configDir, vm->def) < 0)
+            ret = -1;
     }
 
     VIR_FREE(dev);
-- 
1.6.0.2


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