[PATCH 5/9] qemu: Accept <allowReboot value='default'/>

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

 



Up until a few commits ago, libvirt produced this XML and so
we need to be able to read it back to prevent a bunch of

  error : virXMLPropEnumInternal:516 : XML error: Invalid value
  for attribute 'value' in element 'allowReboot': 'default'

messages from being logged on daemon upgrade when there are
running guests.

Fixes: 0fe2d8dd335054fae38b46bbbac58a4662e1a1d0
Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 5fe05cc09a..88d9499bd0 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2859,9 +2859,12 @@ qemuDomainObjPrivateXMLParseAllowReboot(xmlXPathContextPtr ctxt,
 {
     xmlNodePtr node = virXPathNode("./allowReboot", ctxt);
 
-    return virXMLPropTristateBool(node, "value",
-                                  VIR_XML_PROP_NONE,
-                                  allowReboot);
+    /* Allow value='default' as the input here, because old versions
+     * of libvirt produced that output and we need to be able to read
+     * it back to correctly handle running guests on daemon upgrade */
+    return virXMLPropTristateBoolAllowDefault(node, "value",
+                                              VIR_XML_PROP_NONE,
+                                              allowReboot);
 }
 
 
-- 
2.35.1




[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