[RFC PATCH 8/8] qemu: Load domains with invalid XML on start

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

 



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@xxxxxxxxxx>
---
 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 881c5c4c1984..c4df44c9f71f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -312,6 +312,7 @@ qemuAutostartDomain(virDomainObjPtr vm,
     virObjectRef(vm);
     virResetLastError();
     if (vm->autostart &&
+        !vm->def->parseError &&
         !virDomainObjIsActive(vm)) {
         if (qemuDomainObjBeginJob(data->driver, vm,
                                   QEMU_JOB_MODIFY) < 0) {
@@ -951,7 +952,7 @@ qemuStateInitialize(bool privileged,
                                        cfg->autostartDir, 0,
                                        qemu_driver->caps,
                                        qemu_driver->xmlopt,
-                                       false,
+                                       true,
                                        NULL, NULL) < 0)
         goto error;

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

--
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]