mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 05:25:18 +00:00
conf: domain: Convert virDomainDiskDef's 'model' to virDomainDiskModel
Use the appropriate type for the variable and refactor the XML parser to parse it correctly using virXMLPropEnum. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
e3434446c5
commit
21c10943a9
@ -9345,13 +9345,9 @@ virDomainDiskDefParseXML(virDomainXMLOption *xmlopt,
|
||||
}
|
||||
VIR_FREE(tmp);
|
||||
|
||||
if ((tmp = virXMLPropString(node, "model")) &&
|
||||
(def->model = virDomainDiskModelTypeFromString(tmp)) < 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unknown disk model '%s'"), tmp);
|
||||
if (virXMLPropEnum(node, "model", virDomainDiskModelTypeFromString,
|
||||
VIR_XML_PROP_OPTIONAL, &def->model) < 0)
|
||||
return NULL;
|
||||
}
|
||||
VIR_FREE(tmp);
|
||||
|
||||
snapshot = virXMLPropString(node, "snapshot");
|
||||
|
||||
|
@ -584,7 +584,7 @@ struct _virDomainDiskDef {
|
||||
int detect_zeroes; /* enum virDomainDiskDetectZeroes */
|
||||
char *domain_name; /* backend domain name */
|
||||
unsigned int queues;
|
||||
int model; /* enum virDomainDiskModel */
|
||||
virDomainDiskModel model;
|
||||
virDomainVirtioOptions *virtio;
|
||||
|
||||
bool diskElementAuth;
|
||||
|
Loading…
x
Reference in New Issue
Block a user