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>
_("unknown video model '%s'"), type);
return NULL;
}
- } else {
- def->type = VIR_DOMAIN_VIDEO_TYPE_DEFAULT;
}
if ((ram = virXPathString("string(./model/@ram)", ctxt))) {
if (!(video = virDomainVideoDefNew(xmlopt)))
return -1;
- video->type = VIR_DOMAIN_VIDEO_TYPE_DEFAULT;
VIR_APPEND_ELEMENT(def->videos, def->nvideos, video);
return 0;
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,