提交 ad11ecd9 编写于 作者: H Harry Wei 提交者: Eric Blake

sheepdog: skip refresh on creation failure

Don't try to refresh Sheepdog volume if creating volume fails.
Signed-off-by: NHarry Wei <harryxiyou@gmail.com>
上级 f3531a04
...@@ -156,7 +156,7 @@ virStorageBackendSheepdogCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED, ...@@ -156,7 +156,7 @@ virStorageBackendSheepdogCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED,
virStorageVolDefPtr vol) virStorageVolDefPtr vol)
{ {
int ret; int ret = -1;
if (vol->target.encryption != NULL) { if (vol->target.encryption != NULL) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
...@@ -167,10 +167,14 @@ virStorageBackendSheepdogCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED, ...@@ -167,10 +167,14 @@ virStorageBackendSheepdogCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED,
virCommandPtr cmd = virCommandNewArgList(COLLIE, "vdi", "create", vol->name, NULL); virCommandPtr cmd = virCommandNewArgList(COLLIE, "vdi", "create", vol->name, NULL);
virCommandAddArgFormat(cmd, "%llu", vol->capacity); virCommandAddArgFormat(cmd, "%llu", vol->capacity);
virStorageBackendSheepdogAddHostArg(cmd, pool); virStorageBackendSheepdogAddHostArg(cmd, pool);
ret = virCommandRun(cmd, NULL); if (virCommandRun(cmd, NULL) < 0)
goto cleanup;
virStorageBackendSheepdogRefreshVol(conn, pool, vol); if (virStorageBackendSheepdogRefreshVol(conn, pool, vol) < 0)
goto cleanup;
ret = 0;
cleanup:
virCommandFree(cmd); virCommandFree(cmd);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册