mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
conf, qemu: Replace access to disk driver name with accessors
Replace direct usage of disk->src->driverName with the existing accessors. The parser code where we assign the driver from XML is intentionally not fixed to save an allocation. Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
ca2943ad9a
commit
b2e54a3377
@ -9400,7 +9400,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
|
|||||||
physical_block_size);
|
physical_block_size);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
} else if (!def->src->driverName &&
|
} else if (!virDomainDiskGetDriver(def) &&
|
||||||
virXMLNodeNameEqual(cur, "driver")) {
|
virXMLNodeNameEqual(cur, "driver")) {
|
||||||
if (virDomainVirtioOptionsParseXML(cur, &def->virtio) < 0)
|
if (virDomainVirtioOptionsParseXML(cur, &def->virtio) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
@ -23101,7 +23101,7 @@ virDomainDiskDefFormat(virBufferPtr buf,
|
|||||||
virBufferAddLit(buf, ">\n");
|
virBufferAddLit(buf, ">\n");
|
||||||
virBufferAdjustIndent(buf, 2);
|
virBufferAdjustIndent(buf, 2);
|
||||||
|
|
||||||
virBufferEscapeString(&driverBuf, " name='%s'", def->src->driverName);
|
virBufferEscapeString(&driverBuf, " name='%s'", virDomainDiskGetDriver(def));
|
||||||
if (def->src->format > 0)
|
if (def->src->format > 0)
|
||||||
virBufferAsprintf(&driverBuf, " type='%s'",
|
virBufferAsprintf(&driverBuf, " type='%s'",
|
||||||
virStorageFileFormatTypeToString(def->src->format));
|
virStorageFileFormatTypeToString(def->src->format));
|
||||||
|
@ -783,7 +783,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
|
|||||||
def->device = VIR_DOMAIN_DISK_DEVICE_FLOPPY;
|
def->device = VIR_DOMAIN_DISK_DEVICE_FLOPPY;
|
||||||
}
|
}
|
||||||
} else if (STREQ(keywords[i], "format")) {
|
} else if (STREQ(keywords[i], "format")) {
|
||||||
if (VIR_STRDUP(def->src->driverName, "qemu") < 0)
|
if (virDomainDiskSetDriver(def, "qemu") < 0)
|
||||||
goto error;
|
goto error;
|
||||||
def->src->format = virStorageFileFormatTypeFromString(values[i]);
|
def->src->format = virStorageFileFormatTypeFromString(values[i]);
|
||||||
} else if (STREQ(keywords[i], "cache")) {
|
} else if (STREQ(keywords[i], "cache")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user