[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [qemu-xen-unstable] xs_rm xenstore command from xend after we read it
commit 2b3cd7ff7af0fff9314abae999e0e67c21041ffc Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> Date: Thu Jun 18 14:53:58 2009 +0100 xs_rm xenstore command from xend after we read it in xenstore_process_dm_command_event(), xs_rm the command node after we read it. As Ian Jackson pointed out: "when we start processing a command we should delete it from xenstore immediately, so that future watch triggerings either don't see the command or actually see genuine new invocations". The patch is used to overcome a race condition that occurs after changeset 19679: ec2bc4b9fa32 (xend: hot-plug PCI devices at boot-time) and could break the device assignment of hvm guest: ioemu's xs_watch() fires the 'command' for the 1st time and xend's signalDeviceModel('pci-ins',...) fires it for the 2nd time -- without the patch, the 2nd time watch handling would try to invoke xenstore_process_dm_command_event() again and since the 'parameter' node has been changed to hold vslot by ioemu, the second time would fail and set 'parameter' to "no free hotplug slots" at the end of the 2nd handling; and, if xend runs slower, xend would treat the 'parameter' of the 2nd time as that of the 1st time and destroy the guest. Signed-off-by: Dexuan Cui <dexuan.cui@xxxxxxxxx> --- xenstore.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/xenstore.c b/xenstore.c index d2f38d2..0618c80 100644 --- a/xenstore.c +++ b/xenstore.c @@ -756,6 +756,9 @@ static void xenstore_process_dm_command_event(void) if (!command) goto out; + if (!xs_rm(xsh, XBT_NULL, path)) + fprintf(logfile, "xs_rm failed: path=%s\n", path); + if (!strncmp(command, "save", len)) { fprintf(logfile, "dm-command: pause and save state\n"); xen_pause_requested = 1; -- generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |