mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 20:02:21 +00:00
virDomainGraphicsDefParseXML: Use virXMLProp*
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
b975a8a755
commit
7e07c50dc0
@ -13230,25 +13230,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"));
|
||||
if (virXMLPropEnum(node, "type", virDomainGraphicsTypeFromString,
|
||||
VIR_XML_PROP_REQUIRED, &def->type) < 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if ((typeVal = virDomainGraphicsTypeFromString(type)) < 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unknown graphics device type '%s'"), type);
|
||||
goto error;
|
||||
}
|
||||
def->type = typeVal;
|
||||
|
||||
switch (def->type) {
|
||||
case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
|
||||
|
Loading…
x
Reference in New Issue
Block a user