From: Jonathon Jongsma Date: Mon, 7 Nov 2022 15:34:55 +0000 (-0600) Subject: conf: explicitly set VIR_DOMAIN_VIDEO_TYPE_DEFAULT to 0 X-Git-Tag: v9.2.0-rc1~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cbc03210fe9f43cce4ad7f8aeff32655b527b40;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Ján Tomko --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f7f9ec3c0a..53b3a1139c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 21ea4a48b3..bacadb5ae0 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -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,