Re: [RFC] virCommandRun return error number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 11, 2013 at 9:38 PM, Michal Privoznik <mprivozn@xxxxxxxxxx> wrote:
[...]
> Maybe you've pasted wrong code snippet, but the one you've pasted is
> correct. If virCommandRun() fails and returns -1; we return that value
> to the caller. And if the command doesn't fail, we call
> virStorageBackendSheepdogParseNodeInfo to parse output of the command.
>

Sorry, i have asked for a stupid bug. Let us check following one.

[...]
114 static int
115 virStorageBackendSheepdogRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
116                                      virStoragePoolObjPtr pool)
117 {
118     int ret;
119     char *output = NULL;
120     virCommandPtr cmd;
121
122     cmd = virCommandNewArgList(COLLIE, "node", "info", "-r", NULL);
123     virStorageBackendSheepdogAddHostArg(cmd, pool);
[...]

virCommandNewArgList may return ‘NULL’, so i think we should check
this condition, which we need not do following stuffs, right?


--
Thanks
Harry Wei

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]