mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +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
|
||||
* valid for block disk.
|
||||
*/
|
||||
if (disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK ||
|
||||
!disk->shared || !disk->src)
|
||||
if (!disk->shared ||
|
||||
!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;
|
||||
|
||||
qemuDriverLock(driver);
|
||||
@ -1171,8 +1175,12 @@ qemuRemoveSharedDisk(virQEMUDriverPtr driver,
|
||||
int ret = -1;
|
||||
int idx;
|
||||
|
||||
if (disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK ||
|
||||
!disk->shared || !disk->src)
|
||||
if (!disk->shared ||
|
||||
!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;
|
||||
|
||||
qemuDriverLock(driver);
|
||||
|
Loading…
Reference in New Issue
Block a user