Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/domain_conf.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3a4b01ad1e..e1b2baf621 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6620,8 +6620,6 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xmlopt,
xmlNodePtr boot = NULL;
xmlNodePtr rom = NULL;
int ret = -1;
- g_autofree char *romenabled = NULL;
- g_autofree char *rombar = NULL;
g_autofree char *aliasStr = NULL;
virDomainDeviceInfoClear(info);
@@ -6673,18 +6671,17 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xmlopt,
}
if (rom) {
- if ((romenabled = virXMLPropString(rom, "enabled")) &&
- ((info->romenabled = virTristateBoolTypeFromString(romenabled)) <= 0))
{
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unknown rom enabled value '%s'"),
romenabled);
+ virTristateBool romenabled = VIR_TRISTATE_BOOL_ABSENT;
+ virTristateSwitch rombar = VIR_TRISTATE_SWITCH_ABSENT;
+
+ if (virXMLPropYesNo(rom, "enabled", &romenabled) < 0)
goto cleanup;
- }
- if ((rombar = virXMLPropString(rom, "bar")) &&
- ((info->rombar = virTristateSwitchTypeFromString(rombar)) <= 0)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unknown rom bar value '%s'"), rombar);
+
+ if (virXMLPropOnOff(rom, "bar", &rombar) < 0)
goto cleanup;
- }
+
+ info->romenabled = romenabled;
+ info->rombar = rombar;
info->romfile = virXMLPropString(rom, "file");
if (info->romenabled == VIR_TRISTATE_BOOL_NO &&
--
2.26.2