[libvirt] [PATCH v2 10/10] qemu: Load domains with invalid XML on start

Martin Kletzander mkletzan at redhat.com
Tue Dec 1 17:35:25 UTC 2015


If we load such domains, we don't need to handle invalid XML checking in
qemuProcessStart, but we can move it to qemuDomainDefPostParse() or even
into the parsing functions if all goes well.  So the only thing we'll
need to worry about after this is XML parsing code that would error out
for running domains or non-qemu drivers.  The latter will be fixed in
following patches, hence making the active XML parsing the only
problematic part.

Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
 src/qemu/qemu_driver.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 0f8a19836c43..e9cd7464f18d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -313,6 +313,7 @@ qemuAutostartDomain(virDomainObjPtr vm,
     virObjectRef(vm);
     virResetLastError();
     if (vm->autostart &&
+        !vm->def->parseError &&
         !virDomainObjIsActive(vm)) {
         if (qemuProcessBeginJob(data->driver, vm) < 0) {
             err = virGetLastError();
@@ -954,7 +955,7 @@ qemuStateInitialize(bool privileged,
                                        cfg->autostartDir, 0,
                                        qemu_driver->caps,
                                        qemu_driver->xmlopt,
-                                       false,
+                                       true,
                                        NULL, NULL) < 0)
         goto error;

@@ -1035,7 +1036,7 @@ qemuStateReload(void)
                                    cfg->configDir,
                                    cfg->autostartDir, 0,
                                    caps, qemu_driver->xmlopt,
-                                   false,
+                                   true,
                                    qemuNotifyLoadDomain, qemu_driver);
  cleanup:
     virObjectUnref(cfg);
-- 
2.6.3




More information about the libvir-list mailing list