There's only one caller now anyway... Besides it's just a shell for
getting the compress type. Subsequent patches will return the path
to the compression program.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/qemu/qemu_driver.c | 25 +++++++------------------
1 file changed, 7 insertions(+), 18 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 1c41c7d..4cd0a07 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3310,23 +3310,6 @@ qemuGetCompressionProgram(const char *imageFormat)
}
-static virQEMUSaveFormat
-getCompressionType(virQEMUDriverPtr driver)
-{
- int ret;
- virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
-
- /*
- * We reuse "save" flag for "dump" here. Then, we can support the
same
- * format in "save" and "dump".
- */
- ret = qemuGetCompressionProgram(cfg->dumpImageFormat);
-
- virObjectUnref(cfg);
- return ret;
-}
-
-
static int
qemuDomainSaveFlags(virDomainPtr dom, const char *path, const char *dxml,
unsigned int flags)
@@ -3602,7 +3585,12 @@ doCoreDump(virQEMUDriverPtr driver,
int directFlag = 0;
unsigned int flags = VIR_FILE_WRAPPER_NON_BLOCKING;
const char *memory_dump_format = NULL;
- virQEMUSaveFormat compress = getCompressionType(driver);
+ virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+ virQEMUSaveFormat compress;
+
+ /* We reuse "save" flag for "dump" here. Then, we can support the
same
+ * format in "save" and "dump". */
+ compress = qemuGetCompressionProgram(cfg->dumpImageFormat);
/* Create an empty file with appropriate ownership. */
if (dump_flags & VIR_DUMP_BYPASS_CACHE) {
@@ -3673,6 +3661,7 @@ doCoreDump(virQEMUDriverPtr driver,
if (ret != 0)
unlink(path);
virFileWrapperFdFree(wrapperFd);
+ virObjectUnref(cfg);
return ret;
}
--
2.7.4