mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
conf: disk: Avoid temporary variable when parsing driver name
This commit is contained in:
parent
b8635011ec
commit
f3f931b6c0
@ -6919,7 +6919,6 @@ static int
|
||||
virDomainDiskDefDriverParseXML(virDomainDiskDefPtr def,
|
||||
xmlNodePtr cur)
|
||||
{
|
||||
char *driverName = NULL;
|
||||
char *driverType = NULL;
|
||||
char *cachetag = NULL;
|
||||
char *error_policy = NULL;
|
||||
@ -6932,7 +6931,7 @@ virDomainDiskDefDriverParseXML(virDomainDiskDefPtr def,
|
||||
char *driverIOThread = NULL;
|
||||
int ret = -1;
|
||||
|
||||
driverName = virXMLPropString(cur, "name");
|
||||
def->src->driverName = virXMLPropString(cur, "name");
|
||||
driverType = virXMLPropString(cur, "type");
|
||||
if (STREQ_NULLABLE(driverType, "aio")) {
|
||||
/* In-place conversion to "raw", for Xen back-compat */
|
||||
@ -6950,9 +6949,6 @@ virDomainDiskDefDriverParseXML(virDomainDiskDefPtr def,
|
||||
discard = virXMLPropString(cur, "discard");
|
||||
driverIOThread = virXMLPropString(cur, "iothread");
|
||||
|
||||
def->src->driverName = driverName;
|
||||
driverName = NULL;
|
||||
|
||||
if (cachetag &&
|
||||
(def->cachemode = virDomainDiskCacheTypeFromString(cachetag)) < 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
@ -7051,7 +7047,6 @@ virDomainDiskDefDriverParseXML(virDomainDiskDefPtr def,
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(driverType);
|
||||
VIR_FREE(driverName);
|
||||
VIR_FREE(cachetag);
|
||||
VIR_FREE(error_policy);
|
||||
VIR_FREE(rerror_policy);
|
||||
|
Loading…
x
Reference in New Issue
Block a user