From b291a00acaddca9047ba06fdf3d9bde570fb95fa Mon Sep 17 00:00:00 2001 From: Viktor Mihajlovski Date: Mon, 17 Jun 2013 16:17:37 +0200 Subject: [PATCH] conf: Swap order of AddImplicitControllers and DomainDefPostParse Implicit controllers may be dependent on device definitions altered in a post-parse callback. Specifically, if a console device is defined without the target type, the type will be set in QEMU's callback. In the case of s390, this is virtio, which requires an implicit virtio-serial controller. Signed-off-by: Viktor Mihajlovski --- src/conf/domain_conf.c | 8 ++++---- .../qemuxml2xmlout-balloon-device-auto.xml | 2 +- .../qemuxml2xmlout-channel-virtio-auto.xml | 2 +- .../qemuxml2xmloutdata/qemuxml2xmlout-console-virtio.xml | 2 +- .../qemuxml2xmlout-disk-scsi-device-auto.xml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e41dfa2e66..011de7127a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -12111,14 +12111,14 @@ virDomainDefParseXML(xmlDocPtr xml, (def->ns.parse)(xml, root, ctxt, &def->namespaceData) < 0) goto error; - /* Auto-add any implied controllers which aren't present */ - if (virDomainDefAddImplicitControllers(def) < 0) - goto error; - /* callback to fill driver specific domain aspects */ if (virDomainDefPostParse(def, caps, xmlopt) < 0) goto error; + /* Auto-add any implied controllers which aren't present */ + if (virDomainDefAddImplicitControllers(def) < 0) + goto error; + virHashFree(bootHash); return def; diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-balloon-device-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-balloon-device-auto.xml index 6aed326c63..380b70f1e8 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-balloon-device-auto.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-balloon-device-auto.xml @@ -20,8 +20,8 @@
- + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-auto.xml index 017527266a..fd6b8524e8 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-auto.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-auto.xml @@ -25,8 +25,8 @@
- +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio.xml index 3c865c3011..340430e3d1 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio.xml @@ -21,8 +21,8 @@ - + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-device-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-device-auto.xml index 7d152bc7b6..5ec1e9422e 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-device-auto.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-device-auto.xml @@ -26,8 +26,8 @@ - +