提交 464d4e55 编写于 作者: O Osier Yang

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.
上级 60b78b33
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册