Received: from eggs.gnu.org ([2001:4830:134:3::10]:34118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZobDh-0008V0-6n for qemu-devel@nongnu.org; Tue, 20 Oct 2015 14:01:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZobDc-0007Ne-0h for qemu-devel@nongnu.org; Tue, 20 Oct 2015 14:01:09 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:50166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZobDb-0007NZ-OA for qemu-devel@nongnu.org; Tue, 20 Oct 2015 14:01:03 -0400 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 20 Oct 2015 19:01:01 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 81D3D1B0804B for ; Tue, 20 Oct 2015 19:01:07 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t9KI0xMM52297808 for ; Tue, 20 Oct 2015 18:01:00 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t9KI0xc4013509 for ; Tue, 20 Oct 2015 12:00:59 -0600 Date: Tue, 20 Oct 2015 20:00:53 +0200 From: Greg Kurz Message-ID: <20151020200053.564a4127@bahia.local> In-Reply-To: <20151020155225-mutt-send-email-mst@redhat.com> References: <20151020091640.25419.99985.stgit@bahia.huguette.org> <20151020155225-mutt-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 0/5] virtio-9p: hotplug and migration support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Cornelia Huck , aneesh.kumar@linux.vnet.ibm.com, qemu-devel@nongnu.org, Andreas =?UTF-8?B?RsOkcmJlcg==?= , Alexander Graf On Tue, 20 Oct 2015 15:53:08 +0300 "Michael S. Tsirkin" wrote: > On Tue, Oct 20, 2015 at 11:16:40AM +0200, Greg Kurz wrote: > > We already have a blocker to prevent migration of an active virtio-9p device. > > But in fact, there is no migration support at all for 9p, even if the device > > is considered to be quiescent (when the VirtFS share is not mounted): migration > > succeeds but the device is lost in the restarted guest. > > Hotunplug of a virtio-9p device is not supported either (no unrealize handler) > > and leads to a QEMU crash on the source node, if one unplugs and migrates. > > > > This series tries to fix that and brings hotplug and migration support of > > *quiescent* virtio-9p devices. > > > > v2->v3: > > - renamed QDEV handler @unpluggable to @unplug_is_blocked (patches 2/5 > > and 3/5) > > > > v1->v2: > > - introduced unplug blocker (patches 2/5 and 3/5) > > - moved fixes to separate patches (see individual changelogs) > > I have some doubts about how hotunplug is handled, but migration > looks ok. > Is there a dependency, or can I just pick savevm things meanwhile? > Well... you can drop the unplug blocker patches (2/5 and 3/5) but the savevm patch (5/5) modifies a function introduced by the unrealize patch (4/5): @@ -146,6 +157,7 @@ static void virtio_9p_device_unrealize(DeviceState *dev, Error **errp) v9fs_release_worker_threads(); g_free(s->ctx.fs_root); g_free(s->tag); + unregister_savevm(dev, "virtio-9p", s); virtio_cleanup(vdev); } and not having an unrealize handler calling unregister_savevm() means unplug will succeed and leave a dangling pointer in the vm_change_state list... This causes a systematic crash of the source QEMU when attempting a migration. > > --- > > > > Greg Kurz (5): > > virtio-9p-coth: fix init function > > qdev: add the @unplug_is_blocked handler > > virtio-9p: block hot-unplug when device is active > > virtio-9p: add unrealize handler > > virtio-9p: add savem handlers > > > > > > hw/9pfs/virtio-9p-coth.c | 22 ++++++++++++++++++---- > > hw/9pfs/virtio-9p-coth.h | 2 ++ > > hw/9pfs/virtio-9p-device.c | 24 ++++++++++++++++++++++++ > > hw/9pfs/virtio-9p.c | 14 ++++++++++++++ > > hw/9pfs/virtio-9p.h | 2 ++ > > hw/core/qdev.c | 4 ++++ > > hw/s390x/virtio-ccw.c | 8 ++++++++ > > hw/virtio/virtio-pci.c | 8 ++++++++ > > include/hw/qdev-core.h | 4 ++++ > > 9 files changed, 84 insertions(+), 4 deletions(-) >