提交 290383cb 编写于 作者: M Michal Privoznik

iscsi_direct: Reset pool capacity and allocation just before refresh

Jirka reported a bug that with every 'virsh pool-refresh' an
iscsi-direct pool would grow and grow. The problem is that
virISCSIDirectRefreshVol() only adds to def->capacity and
def->allocation but nothing clears it out to begin with.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
上级 33a07b8e
......@@ -341,6 +341,7 @@ virISCSIDirectReportLuns(virStoragePoolObjPtr pool,
struct iscsi_context *iscsi,
char *portal)
{
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
struct scsi_task *task = NULL;
struct scsi_reportluns_list *list = NULL;
int full_size;
......@@ -373,6 +374,8 @@ virISCSIDirectReportLuns(virStoragePoolObjPtr pool,
goto cleanup;
}
def->capacity = 0;
def->allocation = 0;
for (i = 0; i < list->num; i++) {
if (virISCSIDirectRefreshVol(pool, iscsi, list->luns[i], portal) < 0)
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册