[libvirt] Fix bugs of Sheepdog storage driver

--- src/storage/storage_backend_sheepdog.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_backend_sheepdog.c index cd18f33..2cbfe01 100644 --- a/src/storage/storage_backend_sheepdog.c +++ b/src/storage/storage_backend_sheepdog.c @@ -168,9 +168,12 @@ virStorageBackendSheepdogCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED, virCommandAddArgFormat(cmd, "%llu", vol->capacity); virStorageBackendSheepdogAddHostArg(cmd, pool); ret = virCommandRun(cmd, NULL); + if (ret < 0) + goto cleanup; - virStorageBackendSheepdogRefreshVol(conn, pool, vol); + ret = virStorageBackendSheepdogRefreshVol(conn, pool, vol); +cleanup: virCommandFree(cmd); return ret; } -- 1.7.0.4

On Thu, Feb 07, 2013 at 12:52:36AM +0800, harryxiyou@gmail.com wrote:
--- src/storage/storage_backend_sheepdog.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_backend_sheepdog.c index cd18f33..2cbfe01 100644 --- a/src/storage/storage_backend_sheepdog.c +++ b/src/storage/storage_backend_sheepdog.c @@ -168,9 +168,12 @@ virStorageBackendSheepdogCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED, virCommandAddArgFormat(cmd, "%llu", vol->capacity); virStorageBackendSheepdogAddHostArg(cmd, pool); ret = virCommandRun(cmd, NULL); + if (ret < 0) + goto cleanup;
You're using tabs in the source which is not allowed, hence this broken indentation. Please make sure to run 'make syntax-check' before submitting changes. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Thu, Feb 7, 2013 at 12:54 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Thu, Feb 07, 2013 at 12:52:36AM +0800, harryxiyou@gmail.com wrote:
--- src/storage/storage_backend_sheepdog.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_backend_sheepdog.c index cd18f33..2cbfe01 100644 --- a/src/storage/storage_backend_sheepdog.c +++ b/src/storage/storage_backend_sheepdog.c @@ -168,9 +168,12 @@ virStorageBackendSheepdogCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED, virCommandAddArgFormat(cmd, "%llu", vol->capacity); virStorageBackendSheepdogAddHostArg(cmd, pool); ret = virCommandRun(cmd, NULL); + if (ret < 0) + goto cleanup;
You're using tabs in the source which is not allowed, hence this broken indentation. Please make sure to run 'make syntax-check' before submitting changes.
I will give a patch after 'make syntax-check'. -- Thanks Harry Wei
participants (3)
-
Daniel P. Berrange
-
harryxiyou
-
harryxiyou@gmail.com