mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemuDomainBlockResize: Always refuse resize of empty/readonly disks
The operation makes no sense regardless of the way how we specify disks. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e231bede44
commit
69e3a31729
@ -9954,8 +9954,6 @@ qemuDomainBlockResize(virDomainPtr dom,
|
||||
disk->src->format == VIR_STORAGE_FILE_QED)
|
||||
size = VIR_ROUND_UP(size, 512);
|
||||
|
||||
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV) &&
|
||||
!qemuDiskBusIsSD(disk->bus)) {
|
||||
if (virStorageSourceIsEmpty(disk->src) || disk->src->readonly) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
_("can't resize empty or readonly disk '%s'"),
|
||||
@ -9963,6 +9961,9 @@ qemuDomainBlockResize(virDomainPtr dom,
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV) &&
|
||||
!qemuDiskBusIsSD(disk->bus)) {
|
||||
|
||||
nodename = disk->src->nodeformat;
|
||||
} else {
|
||||
if (!(device = qemuAliasDiskDriveFromDisk(disk)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user