qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC v4 PATCH 45/49] multi-process/mig: Synchronize runstate of remo


From: Jag Raman
Subject: Re: [RFC v4 PATCH 45/49] multi-process/mig: Synchronize runstate of remote process
Date: Wed, 13 Nov 2019 11:33:23 -0500
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1



On 11/11/2019 11:17 AM, Stefan Hajnoczi wrote:
On Thu, Oct 24, 2019 at 05:09:26AM -0400, Jagannathan Raman wrote:
@@ -656,6 +657,19 @@ static void init_proxy(PCIDevice *dev, char *command, bool 
need_spawn, Error **e
      }
  }
+static void proxy_vm_state_change(void *opaque, int running, RunState state)
+{
+    PCIProxyDev *dev = opaque;
+    MPQemuMsg msg = { 0 };
+
+    msg.cmd = RUNSTATE_SET;
+    msg.bytestream = 0;
+    msg.size = sizeof(msg.data1);
+    msg.data1.runstate.state = state;
+
+    mpqemu_msg_send(dev->mpqemu_link, &msg, dev->mpqemu_link->com);
+}

Changing vm state is a barrier operation - devices must not dirty memory
afterwards.  This function doesn't have barrier semantics, it sends off
the message without waiting for the remote process to finish processing
it.  This means there is a race condition where QEMU has changes the vm
state but devices could still dirty memory.  Please wait for a reply to
prevent this.

Got it, thanks! Will do.

--
Jag


Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]