[RFC 1/1] virxml: Accept 'default' for virTristate* properties

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

 



The _ABSENT value of each enumeration has 'default' as string
representation, and when that's been formatted to XML we should
parse it back successfully, so we can't just treat encountering
it as an error.

Callers of virXMLPropTristate*() can of course still pass
VIR_XML_PROP_NONZERO explicitly to the helpers if the current
behavior is the one they want.

After this change, libvirtd no longer logs

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

when it gets restarted while there are running guests.

Fixes: 8861d96c880d25c940456c5997a2ac93fc073c78
Fixes: c8726ede83ac117cb18c0b0a1fbfeeac8b80384b
Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/util/virxml.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/util/virxml.c b/src/util/virxml.c
index 8ff59e7cda..db5212de20 100644
--- a/src/util/virxml.c
+++ b/src/util/virxml.c
@@ -545,8 +545,6 @@ virXMLPropTristateBool(xmlNodePtr node,
                        virXMLPropFlags flags,
                        virTristateBool *result)
 {
-    flags |= VIR_XML_PROP_NONZERO;
-
     return virXMLPropEnumInternal(node, name, virTristateBoolTypeFromString,
                                   flags, result, VIR_TRISTATE_BOOL_ABSENT);
 }
@@ -573,8 +571,6 @@ virXMLPropTristateSwitch(xmlNodePtr node,
                          virXMLPropFlags flags,
                          virTristateSwitch *result)
 {
-    flags |= VIR_XML_PROP_NONZERO;
-
     return virXMLPropEnumInternal(node, name, virTristateSwitchTypeFromString,
                                   flags, result, VIR_TRISTATE_SWITCH_ABSENT);
 }
-- 
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