From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xw6E1-0008BA-QN for qemu-devel@nongnu.org; Wed, 03 Dec 2014 04:28:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xw6Do-0001ie-3t for qemu-devel@nongnu.org; Wed, 03 Dec 2014 04:27:57 -0500 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:46437) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xw6Dn-0001iJ-R6 for qemu-devel@nongnu.org; Wed, 03 Dec 2014 04:27:44 -0500 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 3 Dec 2014 09:27:42 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id CC4F217D8056 for ; Wed, 3 Dec 2014 09:27:57 +0000 (GMT) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sB39RdUP42336280 for ; Wed, 3 Dec 2014 09:27:39 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sB39RcNF011361 for ; Wed, 3 Dec 2014 02:27:38 -0700 Date: Wed, 3 Dec 2014 10:27:36 +0100 From: Cornelia Huck Message-ID: <20141203102736.73576850.cornelia.huck@de.ibm.com> In-Reply-To: <20141202190345.GA5185@redhat.com> References: <1417525227-14051-1-git-send-email-cornelia.huck@de.ibm.com> <1417525227-14051-8-git-send-email-cornelia.huck@de.ibm.com> <20141202144628.GA2974@redhat.com> <20141202155444.0731c48f.cornelia.huck@de.ibm.com> <20141202164136.1a57f358.cornelia.huck@de.ibm.com> <20141202190345.GA5185@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: thuth@linux.vnet.ibm.com, rusty@rustcorp.com.au, qemu-devel@nongnu.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org On Tue, 2 Dec 2014 21:03:45 +0200 "Michael S. Tsirkin" wrote: > On Tue, Dec 02, 2014 at 04:41:36PM +0100, Cornelia Huck wrote: > > void virtio_queue_set_num(VirtIODevice *vdev, int n, int num) > > { > > + /* > > + * For virtio-1 devices, the number of buffers may only be > > + * updated if the ring addresses have not yet been set up. > > Where does it say that? Hmpf, may have imagined that. This means we either need to track whether used/avail have been specified or calculated or move responsibility for re-calculation of used/avail for the old layout into the callers. > > > + */ > > + if (virtio_has_feature(vdev, VIRTIO_F_VERSION_1) && > > + vdev->vq[n].vring.desc) { > > + error_report("tried to modify buffer num for virtio-1 device"); > > + return; > > + } > > /* Don't allow guest to flip queue between existent and > > * nonexistent states, or to set it to an invalid size. > > */ >