qemu: Accept <allowReboot value='default'/>

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: 0fe2d8dd33
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Andrea Bolognani 2022-03-24 19:47:16 +01:00
parent fd3ca84c3e
commit d83d9dde1d

View File

@ -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);
}