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

Eric Blake eblake at redhat.com
Wed Feb 6 15:19:51 UTC 2013


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 at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130206/6eea82b1/attachment-0001.sig>


More information about the libvir-list mailing list