mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 11:52:20 +00:00
qemu: driver: Don't allow certain operations with FD-passed disks
Probing stats and block copy to a FD passed image is not yet supported. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
7ce63d5a07
commit
dc20b1d774
@ -10499,6 +10499,13 @@ qemuDomainBlockPeek(virDomainPtr dom,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virStorageSourceIsFD(disk->src)) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("peeking is not supported for FD passed images"));
|
||||
goto cleanup;
|
||||
|
||||
}
|
||||
|
||||
if (qemuDomainStorageFileInit(driver, vm, disk->src, NULL) < 0)
|
||||
goto cleanup;
|
||||
|
||||
@ -10858,6 +10865,12 @@ qemuDomainGetBlockInfo(virDomainPtr dom,
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (virStorageSourceIsFD(disk->src)) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("block info is not supported for FD passed disk image"));
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
/* for inactive domains we have to peek into the files */
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
if ((qemuStorageLimitsRefresh(driver, cfg, vm, disk->src, false)) < 0)
|
||||
@ -14569,6 +14582,12 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
|
||||
if (!qemuDomainDiskBlockJobIsSupported(disk))
|
||||
goto endjob;
|
||||
|
||||
if (virStorageSourceIsFD(mirror)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("copy to a FD passed disk source is not yet supported"));
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN &&
|
||||
virDomainDiskDefSourceLUNValidate(mirror) < 0)
|
||||
goto endjob;
|
||||
@ -17679,6 +17698,9 @@ qemuDomainGetStatsOneBlockFallback(virQEMUDriver *driver,
|
||||
if (virStorageSourceIsEmpty(src))
|
||||
return 0;
|
||||
|
||||
if (virStorageSourceIsFD(src))
|
||||
return 0;
|
||||
|
||||
if (qemuStorageLimitsRefresh(driver, cfg, dom, src, true) <= 0) {
|
||||
virResetLastError();
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user