[PATCH 03/12] qemu: Move assignment of default emulator to the basic post parse callback

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

 



---
 src/qemu/qemu_domain.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 40608554c..9e395aec9 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2924,9 +2924,23 @@ qemuDomainDefVerifyFeatures(const virDomainDef *def)
 }


+static int
+qemuDomainDefPostParseBasic(virDomainDefPtr def,
+                            virCapsPtr caps,
+                            void *opaque ATTRIBUTE_UNUSED)
+{
+    /* check for emulator and create a default one if needed */
+    if (!def->emulator &&
+        !(def->emulator = virDomainDefGetDefaultEmulator(def, caps)))
+        return -1;
+
+    return 0;
+}
+
+
 static int
 qemuDomainDefPostParse(virDomainDefPtr def,
-                       virCapsPtr caps,
+                       virCapsPtr caps ATTRIBUTE_UNUSED,
                        unsigned int parseFlags,
                        void *opaque,
                        void *parseOpaque)
@@ -2957,11 +2971,6 @@ qemuDomainDefPostParse(virDomainDefPtr def,
             goto cleanup;
     }

-    /* check for emulator and create a default one if needed */
-    if (!def->emulator &&
-        !(def->emulator = virDomainDefGetDefaultEmulator(def, caps)))
-        goto cleanup;
-
     if (qemuCaps) {
         virObjectRef(qemuCaps);
     } else {
@@ -3716,6 +3725,7 @@ qemuDomainDefAssignAddresses(virDomainDef *def,


 virDomainDefParserConfig virQEMUDriverDomainDefParserConfig = {
+    .domainPostParseBasicCallback = qemuDomainDefPostParseBasic,
     .devicesPostParseCallback = qemuDomainDeviceDefPostParse,
     .domainPostParseCallback = qemuDomainDefPostParse,
     .assignAddressesCallback = qemuDomainDefAssignAddresses,
-- 
2.14.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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