mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-25 04:42:20 +00:00
xenconfig: xm: check for driver on disk format
When reviewing libxl vif typename series[0] I found a bug on xen-xm formatter where "virsh domxml-to-native xen-xm file.xml" can lead to a NULL dereference if the disk driver isn't specified. Fix this by checking for driver before writing/testing it down. [0] https://www.redhat.com/archives/libvir-list/2016-April/msg01434.html Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
This commit is contained in:
parent
002b7704ff
commit
293668cd70
@ -297,9 +297,12 @@ xenFormatXMDisk(virConfValuePtr list,
|
||||
type = "aio";
|
||||
else
|
||||
type = virStorageFileFormatTypeToString(format);
|
||||
|
||||
if (driver) {
|
||||
virBufferAsprintf(&buf, "%s:", driver);
|
||||
if (STREQ(driver, "tap"))
|
||||
virBufferAsprintf(&buf, "%s:", type);
|
||||
}
|
||||
} else {
|
||||
switch (virDomainDiskGetType(disk)) {
|
||||
case VIR_STORAGE_TYPE_FILE:
|
||||
|
Loading…
x
Reference in New Issue
Block a user