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

[libvirt] [PATCH] qemuDriver: check for migrate command



Hi,
qemu doesn't know about "migrate" used to save a qemu/kvm domain.
Current CVS fails silently - this patch checks if the command if
available.
Cheers,
 -- Guido
[PATCH] check for the existence of the "migrate" command

for kvm/qemu domain safeing. Qemu doesn't have this yet.
---
 src/qemu_driver.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 3d0b6c5..01b4d18 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -2417,6 +2417,19 @@ static int qemudDomainSave(virDomainPtr dom,
         return -1;
     }
 
+    DEBUG ("migrate reply: %s", info);
+
+    /* If the command isn't supported then qemu prints:
+     * unknown command: migrate" */
+    if (strstr(info, "unknown command:")) {
+        qemudReportError (dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT,
+                          "%s",
+                          _("'migrate' not supported by this qemu"));
+        VIR_FREE(info);
+        VIR_FREE(command);
+        return -1;
+    }
+
     VIR_FREE(info);
     VIR_FREE(command);
 
-- 
1.5.6.3


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