Retry JSON monitor cont cmd on MigrationExpected error
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=91
This commit is contained in:
parent
b62b15355b
commit
40a87d6549
54
4301b95a-json-cont-cmd.patch
Normal file
54
4301b95a-json-cont-cmd.patch
Normal file
@ -0,0 +1,54 @@
|
||||
commit 4301b95af7f554700de8e69ecf3f3bb3148b1d44
|
||||
Author: Jim Fehlig <jfehlig@novell.com>
|
||||
Date: Thu Jan 13 12:52:23 2011 -0700
|
||||
|
||||
[v2] qemu: Retry JSON monitor cont cmd on MigrationExpected error
|
||||
|
||||
When restoring a saved qemu instance via JSON monitor, the vm is
|
||||
left in a paused state. Turns out the 'cont' cmd was failing with
|
||||
"MigrationExpected" error class and "An incoming migration is
|
||||
expected before this command can be executed" error description
|
||||
due to migration (restore) not yet complete.
|
||||
|
||||
Detect if 'cont' cmd fails with "MigrationExpecte" error class and
|
||||
retry 'cont' cmd.
|
||||
|
||||
V2: Fix potential double-free noted by Laine Stump
|
||||
|
||||
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
|
||||
index 2e159c7..ca06e7e 100644
|
||||
--- a/src/qemu/qemu_monitor_json.c
|
||||
+++ b/src/qemu/qemu_monitor_json.c
|
||||
@@ -702,13 +702,29 @@ qemuMonitorJSONStartCPUs(qemuMonitorPtr mon,
|
||||
int ret;
|
||||
virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("cont", NULL);
|
||||
virJSONValuePtr reply = NULL;
|
||||
+ int i = 0, timeout = 3;
|
||||
if (!cmd)
|
||||
return -1;
|
||||
|
||||
- ret = qemuMonitorJSONCommand(mon, cmd, &reply);
|
||||
+ do {
|
||||
+ ret = qemuMonitorJSONCommand(mon, cmd, &reply);
|
||||
|
||||
- if (ret == 0)
|
||||
- ret = qemuMonitorJSONCheckError(cmd, reply);
|
||||
+ if (ret != 0)
|
||||
+ break;
|
||||
+
|
||||
+ /* If no error, we're done */
|
||||
+ if ((ret = qemuMonitorJSONCheckError(cmd, reply)) == 0)
|
||||
+ break;
|
||||
+
|
||||
+ /* If error class is not MigrationExpected, we're done.
|
||||
+ * Otherwise try 'cont' cmd again */
|
||||
+ if (!qemuMonitorJSONHasError(reply, "MigrationExpected"))
|
||||
+ break;
|
||||
+
|
||||
+ virJSONValueFree(reply);
|
||||
+ reply = NULL;
|
||||
+ usleep(250000);
|
||||
+ } while (++i <= timeout);
|
||||
|
||||
virJSONValueFree(cmd);
|
||||
virJSONValueFree(reply);
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 21 11:04:07 MST 2011 - jfehlig@novell.com
|
||||
|
||||
- Retry JSON monitor 'cont' cmd on MigrationExpected error
|
||||
4301b95a-json-cont-cmd.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jan 18 14:57:18 MST 2011 - jfehlig@novell.com
|
||||
|
||||
|
@ -178,6 +178,7 @@ Patch2: 04197350-hap2.patch
|
||||
Patch3: af521a01-hap3.patch
|
||||
Patch4: 79f56c66-hap4.patch
|
||||
Patch5: 094c6f4a-hap-fix.patch
|
||||
Patch6: 4301b95a-json-cont-cmd.patch
|
||||
# Need to go upstream
|
||||
Patch100: xen-name-for-devid.patch
|
||||
Patch102: clone.patch
|
||||
@ -296,6 +297,7 @@ Authors:
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch100 -p1
|
||||
%patch102
|
||||
%patch103 -p1
|
||||
|
Loading…
Reference in New Issue
Block a user