mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 13:47:13 +03: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,14 +9954,15 @@ qemuDomainBlockResize(virDomainPtr dom,
|
||||
disk->src->format == VIR_STORAGE_FILE_QED)
|
||||
size = VIR_ROUND_UP(size, 512);
|
||||
|
||||
if (virStorageSourceIsEmpty(disk->src) || disk->src->readonly) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
_("can't resize empty or readonly disk '%s'"),
|
||||
disk->dst);
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
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'"),
|
||||
disk->dst);
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
nodename = disk->src->nodeformat;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user