Received: from eggs.gnu.org ([2001:4830:134:3::10]:36488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYrh7-0004aa-JM for qemu-devel@nongnu.org; Mon, 07 Sep 2015 04:22:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYrh4-0000nP-Ga for qemu-devel@nongnu.org; Mon, 07 Sep 2015 04:22:29 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:52241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYrh4-0000ms-6n for qemu-devel@nongnu.org; Mon, 07 Sep 2015 04:22:26 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 7 Sep 2015 09:22:22 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id BCD0917D8063 for ; Mon, 7 Sep 2015 09:22:59 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t878LFQc35324120 for ; Mon, 7 Sep 2015 08:21:15 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t878LEIa023094 for ; Mon, 7 Sep 2015 02:21:14 -0600 Date: Mon, 7 Sep 2015 10:21:11 +0200 From: Cornelia Huck Message-ID: <20150907102111.7c2ec0dd.cornelia.huck@de.ibm.com> In-Reply-To: <55ED3F4F.4060504@redhat.com> References: <1441164325-14417-1-git-send-email-jasowang@redhat.com> <1441164325-14417-5-git-send-email-jasowang@redhat.com> <20150902130630.662ae71b.cornelia.huck@de.ibm.com> <55ED3F4F.4060504@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V2 4/8] virtio-pci: fix 1.0 virtqueue migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: qemu-devel@nongnu.org, mst@redhat.com On Mon, 7 Sep 2015 15:39:59 +0800 Jason Wang wrote: > On 09/02/2015 07:06 PM, Cornelia Huck wrote: > > On Wed, 2 Sep 2015 11:25:21 +0800 > > Jason Wang wrote: > >> +static int get_extra_state(QEMUFile *f, void *pv, size_t size) > >> +{ > >> + VirtIODevice *vdev = pv; > >> + BusState *qbus = qdev_get_parent_bus(DEVICE(vdev)); > >> + VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); > >> + int ret = 0; > >> + > >> + ret = k->load_extra_state(qbus->parent, f); > > Should we check for ->load_extra_state() and return failure if it does > > not exist? > > I think checking the existence of has_extra_state() in > virtio_extra_state_needed() is enough for this? Or is there anything I miss? The has_extra_state() callback is called by the sender, not by the receiver. If the other side sent the extra state but we can't handle it, I think it would be better to fail the migration than to crash. Still broken code, but probably easier to debug :)