[libvirt] [PATCH] fix some bugs of sheepdog storage driver
Eric Blake
eblake at redhat.com
Fri Feb 8 12:51:27 UTC 2013
On 02/08/2013 03:48 AM, harryxiyou at gmail.com wrote:
> Signed-off-by: Harry Wei <harryxiyou at gmail.com>
>
> ---
> src/storage/storage_backend_sheepdog.c | 10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_backend_sheepdog.c
> index 218284d..1ce5aa4 100644
> --- a/src/storage/storage_backend_sheepdog.c
> +++ b/src/storage/storage_backend_sheepdog.c
> @@ -120,6 +120,8 @@ virStorageBackendSheepdogRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
> virCommandPtr cmd;
>
> cmd = virCommandNewArgList(COLLIE, "node", "info", "-r", NULL);
> + if (cmd == NULL)
> + return -1;
> virStorageBackendSheepdogAddHostArg(cmd, pool);
> virCommandSetOutputBuffer(cmd, &output);
> ret = virCommandRun(cmd, NULL);
Not needed. If cmd is NULL, virCommandRun will gracefully report the
OOM message and return -1.
This patch can be dropped.
--
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/20130208/397ec8e5/attachment-0001.sig>
More information about the libvir-list
mailing list