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:
parent
7e94712699
commit
5cbc03210f
@ -12910,8 +12910,6 @@ virDomainVideoDefParseXML(virDomainXMLOption *xmlopt,
|
|||||||
_("unknown video model '%s'"), type);
|
_("unknown video model '%s'"), type);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
def->type = VIR_DOMAIN_VIDEO_TYPE_DEFAULT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ram = virXPathString("string(./model/@ram)", ctxt))) {
|
if ((ram = virXPathString("string(./model/@ram)", ctxt))) {
|
||||||
@ -21833,7 +21831,6 @@ virDomainDefAddImplicitVideo(virDomainDef *def, virDomainXMLOption *xmlopt)
|
|||||||
|
|
||||||
if (!(video = virDomainVideoDefNew(xmlopt)))
|
if (!(video = virDomainVideoDefNew(xmlopt)))
|
||||||
return -1;
|
return -1;
|
||||||
video->type = VIR_DOMAIN_VIDEO_TYPE_DEFAULT;
|
|
||||||
VIR_APPEND_ELEMENT(def->videos, def->nvideos, video);
|
VIR_APPEND_ELEMENT(def->videos, def->nvideos, video);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1768,7 +1768,7 @@ typedef enum {
|
|||||||
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
VIR_DOMAIN_VIDEO_TYPE_DEFAULT,
|
VIR_DOMAIN_VIDEO_TYPE_DEFAULT = 0,
|
||||||
VIR_DOMAIN_VIDEO_TYPE_VGA,
|
VIR_DOMAIN_VIDEO_TYPE_VGA,
|
||||||
VIR_DOMAIN_VIDEO_TYPE_CIRRUS,
|
VIR_DOMAIN_VIDEO_TYPE_CIRRUS,
|
||||||
VIR_DOMAIN_VIDEO_TYPE_VMVGA,
|
VIR_DOMAIN_VIDEO_TYPE_VMVGA,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user