qemu: Alter qemuGetCompressionProgram warning message

Add a new parameter 'styleFormat' to be used when printing the
warning message so that it's "clearer" what style of compression
call caused the error. Add that style to both messages as a paremter.

Also a VIR_WARN error message doesn't need to be translated
 (e.g. inside _()), so remove the need for the translation.
This commit is contained in:
John Ferlan 2016-09-23 07:09:03 -04:00
parent 882e360dac
commit 4052ac2726

View File

@ -3270,6 +3270,7 @@ qemuCompressProgramAvailable(virQEMUSaveFormat compress)
/* qemuGetCompressionProgram: /* qemuGetCompressionProgram:
* @imageFormat: String representation from qemu.conf for the compression * @imageFormat: String representation from qemu.conf for the compression
* image format being used (dump, save, or snapshot). * image format being used (dump, save, or snapshot).
* @styleFormat: String representing the style of format (dump, save, snapshot)
* *
* Returns: * Returns:
* virQEMUSaveFormat - Integer representation of the compression * virQEMUSaveFormat - Integer representation of the compression
@ -3280,7 +3281,8 @@ qemuCompressProgramAvailable(virQEMUSaveFormat compress)
* indicating none. * indicating none.
*/ */
static virQEMUSaveFormat static virQEMUSaveFormat
qemuGetCompressionProgram(const char *imageFormat) qemuGetCompressionProgram(const char *imageFormat,
const char *styleFormat)
{ {
virQEMUSaveFormat ret; virQEMUSaveFormat ret;
@ -3297,12 +3299,13 @@ qemuGetCompressionProgram(const char *imageFormat)
error: error:
if (ret < 0) if (ret < 0)
VIR_WARN("%s", _("Invalid dump image format specified in " VIR_WARN("Invalid %s image format specified in "
"configuration file, using raw")); "configuration file, using raw",
styleFormat);
else else
VIR_WARN("%s", _("Compression program for dump image format " VIR_WARN("Compression program for %s image format in "
"in configuration file isn't available, " "configuration file isn't available, using raw",
"using raw")); styleFormat);
/* Use "raw" as the format if the specified format is not valid, /* Use "raw" as the format if the specified format is not valid,
* or the compress program is not available. */ * or the compress program is not available. */
@ -3590,7 +3593,7 @@ doCoreDump(virQEMUDriverPtr driver,
/* We reuse "save" flag for "dump" here. Then, we can support the same /* We reuse "save" flag for "dump" here. Then, we can support the same
* format in "save" and "dump". */ * format in "save" and "dump". */
compress = qemuGetCompressionProgram(cfg->dumpImageFormat); compress = qemuGetCompressionProgram(cfg->dumpImageFormat, "dump");
/* Create an empty file with appropriate ownership. */ /* Create an empty file with appropriate ownership. */
if (dump_flags & VIR_DUMP_BYPASS_CACHE) { if (dump_flags & VIR_DUMP_BYPASS_CACHE) {