mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 22:15:20 +00:00
qemu: Support shareable volume type disk
Since the source is already translated before. This just adds the checking. Move !disk->shared and !disk->src to improve the performance a bit.
This commit is contained in:
parent
60b78b33e1
commit
464d4e559c
@ -1095,8 +1095,12 @@ qemuAddSharedDisk(virQEMUDriverPtr driver,
|
|||||||
* for the shared disk is "sgio" setting, which is only
|
* for the shared disk is "sgio" setting, which is only
|
||||||
* valid for block disk.
|
* valid for block disk.
|
||||||
*/
|
*/
|
||||||
if (disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK ||
|
if (!disk->shared ||
|
||||||
!disk->shared || !disk->src)
|
!disk->src ||
|
||||||
|
(disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK &&
|
||||||
|
!(disk->type == VIR_DOMAIN_DISK_TYPE_VOLUME &&
|
||||||
|
disk->srcpool &&
|
||||||
|
disk->srcpool->voltype == VIR_STORAGE_VOL_BLOCK)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
qemuDriverLock(driver);
|
qemuDriverLock(driver);
|
||||||
@ -1171,8 +1175,12 @@ qemuRemoveSharedDisk(virQEMUDriverPtr driver,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
int idx;
|
int idx;
|
||||||
|
|
||||||
if (disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK ||
|
if (!disk->shared ||
|
||||||
!disk->shared || !disk->src)
|
!disk->src ||
|
||||||
|
(disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK &&
|
||||||
|
!(disk->type == VIR_DOMAIN_DISK_TYPE_VOLUME &&
|
||||||
|
disk->srcpool &&
|
||||||
|
disk->srcpool->voltype == VIR_STORAGE_VOL_BLOCK)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
qemuDriverLock(driver);
|
qemuDriverLock(driver);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user