1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

conf: explicitly set VIR_DOMAIN_VIDEO_TYPE_DEFAULT to 0

Ensure that new virDomainVideoDef objects have their 'type' set to
VIR_DOMAIN_VIDEO_TYPE_DEFAULT and remove places that this value is set
after construction. Since virDomainVideoDefNew() uses g_new0() allocate
the instance, all fields are initialized to 0.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jonathon Jongsma 2022-11-07 09:34:55 -06:00
parent 7e94712699
commit 5cbc03210f
2 changed files with 1 additions and 4 deletions

View File

@ -12910,8 +12910,6 @@ virDomainVideoDefParseXML(virDomainXMLOption *xmlopt,
_("unknown video model '%s'"), type);
return NULL;
}
} else {
def->type = VIR_DOMAIN_VIDEO_TYPE_DEFAULT;
}
if ((ram = virXPathString("string(./model/@ram)", ctxt))) {
@ -21833,7 +21831,6 @@ virDomainDefAddImplicitVideo(virDomainDef *def, virDomainXMLOption *xmlopt)
if (!(video = virDomainVideoDefNew(xmlopt)))
return -1;
video->type = VIR_DOMAIN_VIDEO_TYPE_DEFAULT;
VIR_APPEND_ELEMENT(def->videos, def->nvideos, video);
return 0;

View File

@ -1768,7 +1768,7 @@ typedef enum {
typedef enum {
VIR_DOMAIN_VIDEO_TYPE_DEFAULT,
VIR_DOMAIN_VIDEO_TYPE_DEFAULT = 0,
VIR_DOMAIN_VIDEO_TYPE_VGA,
VIR_DOMAIN_VIDEO_TYPE_CIRRUS,
VIR_DOMAIN_VIDEO_TYPE_VMVGA,