On 01/26/2011 04:06 AM, Osier Yang wrote:
>> +++ b/src/qemu/qemu_driver.c
>> @@ -4806,16 +4806,15 @@ getCompressionType(struct qemud_driver *driver)
>> if (driver->dumpImageFormat) {
>> compress =
>> qemudSaveCompressionTypeFromString(driver->dumpImageFormat);
>> if (compress< 0) {
>> - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
>> - _("Invalid dump image format specified in
"
>> - "configuration file, using raw"));
>> + VIR_WARN("Invalid dump image format '%s' specified in
"
>> + "configuration file, using raw",
>> + driver->dumpImageFormat);
>
> I'm not sure what the best approach is here - requiring translation for
> all VIR_WARN seems awkward, but so does nwfilter's workaround just to
> avoid a syntax-check rule. Maybe we need a dedicated helper method that
> requires translation but has the same effect as VIR_WARN, which both
> nwfilter and this code can use.
>
Didn't noticed nwfilter driver translates messages for VIR_WARN, good
to known it. But all the VIR_WARN in qemu driver doesn't translate it.
so, will it be fine to push the this patch first, and make dedicated
helper method later as another patch? :-)
Well, technically committing this as-is would be a regression (the
string won't be translated, where it used to be), but no one would see
the regression (without the patch, the message got eaten).
I'm worried that if we don't keep the translation markup now, that we'll
forget and do a release where there is a useful and user-visible message
that fell through the translation cracks. Even if that means touching
this line twice (once now for the same snprintf hack as nwfilter, and
once later once someone writes a cleanup dedicated helper function).
It's always worth a little extra pain to avoid a user-visible regression.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org