This helps moving some checks into the top function
before actually going ahead with the operation.
Signed-off-by: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
---
src/qemu/qemu_domain.c | 45 ++++++++++++++++++++++++++++++++++++---------
1 file changed, 36 insertions(+), 9 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e1d3824..bf91db3 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5354,11 +5354,11 @@ qemuDomainDefValidateDiskLunSource(const virStorageSource *src)
return 0;
}
-int
-qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps,
- virDomainDefPtr vmdef,
- virDomainDeviceDefPtr dev,
- virConnectPtr conn)
+static int
+qemuDomainAttachDeviceConfigInternal(virQEMUCapsPtr qemuCaps,
+ virDomainDefPtr vmdef,
+ virDomainDeviceDefPtr dev,
+ virConnectPtr conn)
{
virDomainDiskDefPtr disk;
virDomainNetDefPtr net;
@@ -5524,9 +5524,20 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps,
return 0;
}
+
int
-qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
- virDomainDeviceDefPtr dev)
+qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps,
+ virDomainDefPtr vmdef,
+ virDomainDeviceDefPtr dev,
+ virConnectPtr conn)
+{
+ return qemuDomainAttachDeviceConfigInternal(qemuCaps, vmdef, dev, conn);
+}
+
+
+static int
+qemuDomainDetachDeviceConfigInternal(virDomainDefPtr vmdef,
+ virDomainDeviceDefPtr dev)
{
virDomainDiskDefPtr disk, det_disk;
virDomainNetDefPtr net;
@@ -5660,10 +5671,18 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
}
int
-qemuDomainUpdateDeviceConfig(virQEMUCapsPtr qemuCaps,
- virDomainDefPtr vmdef,
+qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
virDomainDeviceDefPtr dev)
{
+ return qemuDomainDetachDeviceConfigInternal(vmdef, dev);
+}
+
+
+static int
+qemuDomainUpdateDeviceConfigInternal(virQEMUCapsPtr qemuCaps,
+ virDomainDefPtr vmdef,
+ virDomainDeviceDefPtr dev)
+{
virDomainDiskDefPtr orig, disk;
virDomainGraphicsDefPtr newGraphics;
virDomainNetDefPtr net;
@@ -5753,3 +5772,11 @@ qemuDomainUpdateDeviceConfig(virQEMUCapsPtr qemuCaps,
}
return 0;
}
+
+int
+qemuDomainUpdateDeviceConfig(virQEMUCapsPtr qemuCaps,
+ virDomainDefPtr vmdef,
+ virDomainDeviceDefPtr dev)
+{
+ return qemuDomainUpdateDeviceConfigInternal(qemuCaps, vmdef, dev);
+}