From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xei0F-00034w-Si for qemu-devel@nongnu.org; Thu, 16 Oct 2014 06:09:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xei09-0005eZ-NY for qemu-devel@nongnu.org; Thu, 16 Oct 2014 06:09:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xei09-0005dk-GS for qemu-devel@nongnu.org; Thu, 16 Oct 2014 06:09:45 -0400 Message-ID: <543F995A.5030002@redhat.com> Date: Thu, 16 Oct 2014 12:09:30 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1413364599-7582-1-git-send-email-paul.durrant@citrix.com> <1413364599-7582-3-git-send-email-paul.durrant@citrix.com> <543F75AA.6050701@redhat.com> <9AAE0902D5BC7E449B7C8E4E778ABCD011104E55@AMSPEX01CL01.citrite.net> In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD011104E55@AMSPEX01CL01.citrite.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v3 2/2] Xen: Use the ioreq-server API when available List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Durrant , Peter Maydell Cc: Olaf Hering , Alexey Kardashevskiy , Stefan Weil , Michael Tokarev , QEMU Developers , Alexander Graf , Stefano Stabellini , Gerd Hoffmann , Stefan Hajnoczi , "xen-devel@lists.xenproject.org" Il 16/10/2014 10:25, Paul Durrant ha scritto: >>> +static void xen_hvm_pre_save(void *opaque) >>> +{ >>> + XenIOState *state = opaque; >>> + >>> + /* Stop servicing emulation requests */ >>> + xen_set_ioreq_server_state(xen_xc, xen_domid, state->ioservid, 0); >>> + xen_destroy_ioreq_server(xen_xc, xen_domid, state->ioservid); >>> +} >> >> Is the new use of vmstate_register() really necessary? >> Usually the state you're saving corresponds to some QOM >> device whose vmsd field you can use instead. > > In this case, it seems like a job for a vmstate change handler. > > I looked at that but it did not seem to give me the right semantic, > whereas the pre-save callback gave me exactly the right semantic. What exactly is the right semantics? Note that save _can_ fail, so you need the ability to roll back to the source machine. I think this is missing from your patch, and there is no post_save hook that you can use. Paolo