[libvirt] [PATCH] Add bare %s format string to printf-derivatives called with no format string

Laine Stump laine at laine.org
Thu Jul 23 15:01:15 UTC 2009


On 07/23/2009 06:53 AM, Daniel P. Berrange wrote:
> On Wed, Jul 22, 2009 at 04:22:22PM -0400, Laine Stump wrote:
>    
>> ---
>>   src/datatypes.c       |   24 ++++++++++++------------
>>   src/domain_conf.c     |    9 +++++----
>>   src/interface_conf.c  |    4 ++--
>>   src/lxc_driver.c      |    2 +-
>>   src/qemu_driver.c     |    4 ++--
>>   src/storage_backend.c |    6 +++---
>>   src/virsh.c           |    4 ++--
>>   7 files changed, 27 insertions(+), 26 deletions(-)
>>      
>
> ACK to the changes, but there's a few bits of wierd whitespace in this
>    


Strange. It doesn't make sense for those to accidentally creep in via 
emac's reformatting (except the virsh.c - I probably forgot to set 
"libvirt style" on that file :-), but they also don't look like anything 
I'd do by hand.

Did you correct it, or do you want me to resubmit?


>    
>> @@ -2224,8 +2224,9 @@ virSecurityLabelDefParseXML(virConnectPtr conn,
>>           p = virXPathStringLimit(conn, "string(./seclabel/imagelabel[1])",
>>                                   VIR_SECURITY_LABEL_BUFLEN-1, ctxt);
>>           if (p == NULL) {
>> -            virDomainReportError(conn, VIR_ERR_XML_ERROR,
>> -                                 _("security imagelabel is missing"));
>> +
>> +virDomainReportError(conn, VIR_ERR_XML_ERROR,
>> +                                 "%s", _("security imagelabel is missing"));
>>               goto error;
>>           }
>>           def->seclabel.imagelabel = p;
>> @@ -485,9 +485,9 @@ virStorageBackendCreateQcowCreate(virConnectPtr conn,
>>           return -1;
>>       }
>>       if (vol->backingStore.path != NULL) {
>> -        virStorageReportError(conn, VIR_ERR_NO_SUPPORT,
>> +        virStorageReportError(conn, VIR_ERR_NO_SUPPORT, "%s",
>>                                 _("copy-on-write image not supported with "
>> -                              "qcow-create"));
>> +                                      "qcow-create"));
>>           return -1;
>>       }
>>
>> diff --git a/src/virsh.c b/src/virsh.c
>> index fff73a1..4499aca 100644
>> --- a/src/virsh.c
>> +++ b/src/virsh.c
>> @@ -4869,7 +4869,7 @@ cmdVolClone(vshControl *ctl, const vshCmd *cmd)
>>
>>       origpool = virStoragePoolLookupByVolume(origvol);
>>       if (!origpool) {
>> -        vshError(ctl, FALSE, _("failed to get parent pool"));
>> +    vshError(ctl, FALSE, "%s", _("failed to get parent pool"));
>>           goto cleanup;
>>       }
>>
>> @@ -6583,7 +6583,7 @@ cmdCd(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
>>       int found;
>>
>>       if (!ctl->imode) {
>> -        vshError(ctl, FALSE, _("cd: command valid only in interactive mode"));
>> +    vshError(ctl, FALSE, "%s", _("cd: command valid only in interactive mode"));
>>           return -1;
>>       }
>>      
>
>
> Regards,
> Daniel
>    




More information about the libvir-list mailing list