qemu: Improve docs for virsh dump format

The error in getCompressionType will never be reported, change
the errors codes into warning (VIR_WARN("%s", _(foo)); doesn't break
syntax-check rule), and also improve the docs in qemu.conf to tell
user the truth.
This commit is contained in:
Osier Yang 2011-07-28 09:37:52 +08:00
parent 9a34ebd357
commit 01e1ea1219
2 changed files with 16 additions and 9 deletions

View File

@ -196,8 +196,14 @@
# saving a domain in order to save disk space; the list above is in descending # saving a domain in order to save disk space; the list above is in descending
# order by performance and ascending order by compression ratio. # order by performance and ascending order by compression ratio.
# #
# save_image_format is used when you use 'virsh save' at scheduled saving. # save_image_format is used when you use 'virsh save' at scheduled
# dump_image_format is used when you use 'virsh dump' at emergency crashdump. # saving, and it is an error if the specified save_image_format is
# not valid, or the requested compression program can't be found.
#
# dump_image_format is used when you use 'virsh dump' at emergency
# crashdump, and if the specified dump_image_format is not valid, or
# the requested compression program can't be found, this falls
# back to "raw" compression.
# #
# save_image_format = "raw" # save_image_format = "raw"
# dump_image_format = "raw" # dump_image_format = "raw"

View File

@ -2713,17 +2713,18 @@ getCompressionType(struct qemud_driver *driver)
*/ */
if (driver->dumpImageFormat) { if (driver->dumpImageFormat) {
compress = qemudSaveCompressionTypeFromString(driver->dumpImageFormat); compress = qemudSaveCompressionTypeFromString(driver->dumpImageFormat);
/* Use "raw" as the format if the specified format is not valid,
* or the compress program is not available.
*/
if (compress < 0) { if (compress < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", VIR_WARN("%s", _("Invalid dump image format specified in "
_("Invalid dump image format specified in " "configuration file, using raw"));
"configuration file, using raw"));
return QEMUD_SAVE_FORMAT_RAW; return QEMUD_SAVE_FORMAT_RAW;
} }
if (!qemudCompressProgramAvailable(compress)) { if (!qemudCompressProgramAvailable(compress)) {
qemuReportError(VIR_ERR_OPERATION_FAILED, VIR_WARN("%s", _("Compression program for dump image format "
"%s", _("Compression program for dump image format " "in configuration file isn't available, "
"in configuration file isn't available, " "using raw"));
"using raw"));
return QEMUD_SAVE_FORMAT_RAW; return QEMUD_SAVE_FORMAT_RAW;
} }
} }