[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] Some problem with the save function



Daniel Berteaud wrote:
- the second problem is present since libvirt 0.7.1. Now that the saved
file can be compressed, it seems we cannot save in a raw format any
more.

Yeeowch.

How's this for a fix?
>From b0673955435ca0c441a536b05216497f68f41be0 Mon Sep 17 00:00:00 2001
From: Charles Duffy <Charles_Duffy dell com>
Date: Thu, 17 Sep 2009 18:24:15 -0500
Subject: [PATCH] prevent attempt to call cat -c during virDomainSave to raw

---
 src/qemu_driver.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index a65334f..ff30421 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -3912,10 +3912,15 @@ static int qemudDomainSave(virDomainPtr dom,
         goto cleanup;
     }
 
-    if (STREQ (prog, "raw"))
+    const char *args;
+    if (STREQ (prog, "raw")) {
         prog = "cat";
+        args = "";
+    } else {
+        args = "-c";
+    }
     internalret = virAsprintf(&command, "migrate \"exec:"
-                              "%s -c >> '%s' 2>/dev/null\"", prog, safe_path);
+                              "%s %s >> '%s' 2>/dev/null\"", prog, args, safe_path);
 
     if (internalret < 0) {
         virReportOOMError(dom->conn);
-- 
1.6.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]