[libvirt] [PATCH] virsh: Print error message if argument parsing fails for cmdNodesuspend

Peter Krempa pkrempa at redhat.com
Tue Dec 13 22:24:28 UTC 2011


Dňa 13.12.2011 16:08, Eric Blake  wrote / napísal(a):
> On 12/13/2011 07:31 AM, Michal Privoznik wrote:
>>>
>>> -    if (vshCommandOptString(cmd, "target",&target)<  0)
>>> +    if (vshCommandOptString(cmd, "target",&target)<  0) {
>>> +        vshError(ctl, _("Invalid suspend target argument"));
>> I'd do s/suspend // in all strings you're adding.
>
> Compilation without NLS will trigger gcc warnings that you are using a
> printf-style interface without any %.  Write this as vshError(ctl, "%s",
> _("Invalid target argument")).
>

Oh! Now I understand why there's used notation "%s", "some const string" 
throughout virsh. A quick grep on virsh's source revealed more places 
where this happens and even some strings printed without the translation 
macro. (Well, I was using that format in my previous patches ...). I'll 
look for them and try to fix all the locations in a separate patch.

Peter

>
>
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list




More information about the libvir-list mailing list