Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/domain_conf.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9aba2edf0a..f599d1afe7 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13097,25 +13097,13 @@ virDomainGraphicsDefParseXML(virDomainXMLOption *xmlopt,
unsigned int flags)
{
virDomainGraphicsDef *def;
- int typeVal;
- g_autofree char *type = NULL;
if (!(def = virDomainGraphicsDefNew(xmlopt)))
return NULL;
- type = virXMLPropString(node, "type");
- if (!type) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("missing graphics device type"));
- goto error;
- }
-
- if ((typeVal = virDomainGraphicsTypeFromString(type)) < 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unknown graphics device type '%s'"), type);
+ if (virXMLPropEnum(node, "type", virDomainGraphicsTypeFromString,
+ VIR_XML_PROP_REQUIRED, &def->type) < 0)
goto error;
- }
- def->type = typeVal;
switch (def->type) {
case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
--
2.26.3