[libvirt] [Patch]Sheepdog storage driver ignore refreshVol func's return value

Hi all, In libvirt/src/storage/storage_backend_sheepdog.c file, func virStorageBackendSheepdogCreateVol calls func virStorageBackendSheepdogRefreshVol to refresh Sheepdog volume infos. But we do not check func virStorageBackendSheepdogRefreshVol's return value. Following patch can fix this bug. Signed-off-by: Harry Wei <harryxiyou@gmail.com> Subject: [PATCH] sheepdog driver ignore return value for refresh volume --- 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 66d8fb4..e72c944 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 (0 > ret) + goto cleanup; - virStorageBackendSheepdogRefreshVol(conn, pool, vol); + ret = virStorageBackendSheepdogRefreshVol(conn, pool, vol); +cleanup: virCommandFree(cmd); return ret; } -- 1.7.0.4 -- Thanks Harry Wei

On 02/05/2013 09:48 PM, harryxiyou wrote:
Hi all,
In libvirt/src/storage/storage_backend_sheepdog.c file, func virStorageBackendSheepdogCreateVol calls func virStorageBackendSheepdogRefreshVol to refresh Sheepdog volume infos. But we do not check func virStorageBackendSheepdogRefreshVol's return value. Following patch can fix this bug.
Signed-off-by: Harry Wei <harryxiyou@gmail.com> Subject: [PATCH] sheepdog driver ignore return value for refresh volume
Thanks for attempting a patch. However, the commit message is unconventionally formatted; did you use 'git send-email' to send your patch, as suggested in HACKING? We would have to amend the message to get rid of the 'Hi all,' line, as well as the unusual 'Subject:' line after a sign-off.
--- 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 66d8fb4..e72c944 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 (0 > ret) + goto cleanup;
This patch fails 'make syntax-check', because it used TABs. Also, we tend to use (ret < 0), not (0 > ret), even though they are equivalent.
- virStorageBackendSheepdogRefreshVol(conn, pool, vol); + ret = virStorageBackendSheepdogRefreshVol(conn, pool, vol);
+cleanup: virCommandFree(cmd); return ret; }
Would you mind resubmitting to touch up those issues? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Wed, Feb 6, 2013 at 11:19 PM, Eric Blake <eblake@redhat.com> wrote: [...]
Thanks for attempting a patch. However, the commit message is unconventionally formatted; did you use 'git send-email' to send your patch, as suggested in HACKING? We would have to amend the message to get rid of the 'Hi all,' line, as well as the unusual 'Subject:' line after a sign-off.
Sorry, i did not use 'git send-email' but web client. Yup, i would get rid of some useless stuffs. [...]
Would you mind resubmitting to touch up those issues?
Of course, i'd like to resubmit another patch touching up those issues. Eric, thanks for your suggestions ;-) -- Thanks Harry Wei
participants (2)
-
Eric Blake
-
harryxiyou