From: Cornelia Huck Subject: Re: [PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout Date: Wed, 3 Dec 2014 10:27:36 +0100 Message-ID: <20141203102736.73576850.cornelia.huck@de.ibm.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 Cc: thuth@linux.vnet.ibm.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org To: "Michael S. Tsirkin" Return-path: In-Reply-To: <20141202190345.GA5185@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org List-Id: kvm.vger.kernel.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. > > */ >