mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
conf: use enum variable for video type
Rather than storing the video type as an integer, use the proper enum type within the struct. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
becdee88c3
commit
464a87ec52
@ -12868,7 +12868,6 @@ virDomainVideoModelDefParseXML(virDomainVideoDef *def,
|
||||
xmlNodePtr accel_node;
|
||||
xmlNodePtr res_node;
|
||||
VIR_XPATH_NODE_AUTORESTORE(ctxt)
|
||||
virDomainVideoType type;
|
||||
virTristateBool primary;
|
||||
|
||||
ctxt->node = node;
|
||||
@ -12886,10 +12885,9 @@ virDomainVideoModelDefParseXML(virDomainVideoDef *def,
|
||||
|
||||
if (virXMLPropEnumDefault(node, "type",
|
||||
virDomainVideoTypeFromString,
|
||||
VIR_XML_PROP_NONE, &type,
|
||||
VIR_XML_PROP_NONE, &def->type,
|
||||
VIR_DOMAIN_VIDEO_TYPE_DEFAULT) < 0)
|
||||
return -1;
|
||||
def->type = type;
|
||||
|
||||
if (virXMLPropUInt(node, "ram", 10, VIR_XML_PROP_NONE, &def->ram) < 0)
|
||||
return -1;
|
||||
|
@ -1815,7 +1815,7 @@ struct _virDomainVideoDriverDef {
|
||||
struct _virDomainVideoDef {
|
||||
virObject *privateData;
|
||||
|
||||
int type; /* enum virDomainVideoType */
|
||||
virDomainVideoType type;
|
||||
unsigned int ram; /* kibibytes (multiples of 1024) */
|
||||
unsigned int vram; /* kibibytes (multiples of 1024) */
|
||||
unsigned int vram64; /* kibibytes (multiples of 1024) */
|
||||
|
@ -2378,6 +2378,16 @@ libxlMakeVideo(virDomainDef *def, libxl_domain_config *d_config)
|
||||
}
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_VIDEO_TYPE_DEFAULT:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VMVGA:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VBOX:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VIRTIO:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_GOP:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_NONE:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_BOCHS:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_RAMFB:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_LAST:
|
||||
default:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("video type %s is not supported by libxl"),
|
||||
|
@ -201,6 +201,17 @@ libxlDomainDeviceDefPostParse(virDomainDeviceDef *dev,
|
||||
if (dev->data.video->vram == 0)
|
||||
dev->data.video->vram = 128 * 1024;
|
||||
break;
|
||||
case VIR_DOMAIN_VIDEO_TYPE_DEFAULT:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VMVGA:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VBOX:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VIRTIO:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_GOP:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_NONE:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_BOCHS:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_RAMFB:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_LAST:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1802,9 +1802,16 @@ qemuMonitorJSONUpdateVideoMemorySize(qemuMonitor *mon,
|
||||
}
|
||||
video->vram = prop.val.ul * 1024;
|
||||
break;
|
||||
case VIR_DOMAIN_VIDEO_TYPE_DEFAULT:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_XEN:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VBOX:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VIRTIO:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_GOP:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_NONE:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_BOCHS:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_RAMFB:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_LAST:
|
||||
break;
|
||||
}
|
||||
@ -1842,11 +1849,18 @@ qemuMonitorJSONUpdateVideoVram64Size(qemuMonitor *mon,
|
||||
video->vram64 = prop.val.ul * 1024;
|
||||
}
|
||||
break;
|
||||
case VIR_DOMAIN_VIDEO_TYPE_DEFAULT:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VGA:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VMVGA:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VMVGA:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_XEN:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VBOX:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VIRTIO:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_GOP:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_NONE:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_BOCHS:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_RAMFB:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_LAST:
|
||||
break;
|
||||
}
|
||||
|
@ -3052,9 +3052,16 @@ qemuProcessUpdateVideoRamSize(virQEMUDriver *driver,
|
||||
goto error;
|
||||
}
|
||||
break;
|
||||
case VIR_DOMAIN_VIDEO_TYPE_DEFAULT:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_XEN:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VBOX:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_VIRTIO:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_GOP:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_NONE:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_BOCHS:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_RAMFB:
|
||||
case VIR_DOMAIN_VIDEO_TYPE_LAST:
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user