The config level requires an insert or remove from domain
definition structure.
Signed-off-by: Zhu Guihua <zhugh.fnst(a)cn.fujitsu.com>
---
src/qemu/qemu_driver.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d017a84..a7a50e0 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7313,6 +7313,11 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps,
break;
case VIR_DOMAIN_DEVICE_DIMM:
+ if (virDomainDimmInsert(vmdef, dev->data.dimm) < 0)
+ return -1;
+ dev->data.dimm = NULL;
+ break;
+
case VIR_DOMAIN_DEVICE_INPUT:
case VIR_DOMAIN_DEVICE_SOUND:
case VIR_DOMAIN_DEVICE_VIDEO:
@@ -7349,6 +7354,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
virDomainControllerDefPtr cont, det_cont;
virDomainChrDefPtr chr;
virDomainFSDefPtr fs;
+ virDomainDimmDefPtr dimm;
int idx;
switch ((virDomainDeviceType) dev->type) {
@@ -7430,6 +7436,14 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
break;
case VIR_DOMAIN_DEVICE_DIMM:
+ if (!(dimm = virDomainDimmRemove(vmdef, dev->data.dimm)))
+ return -1;
+
+ virDomainDimmDefFree(dimm);
+ virDomainDimmDefFree(dev->data.dimm);
+ dev->data.dimm = NULL;
+ break;
+
case VIR_DOMAIN_DEVICE_INPUT:
case VIR_DOMAIN_DEVICE_SOUND:
case VIR_DOMAIN_DEVICE_VIDEO:
--
1.9.3