From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8rBK-0005aK-2C for qemu-devel@nongnu.org; Thu, 30 Jan 2014 07:57:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8rBD-0006Ik-U8 for qemu-devel@nongnu.org; Thu, 30 Jan 2014 07:57:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8rBD-0006Ig-Lw for qemu-devel@nongnu.org; Thu, 30 Jan 2014 07:57:15 -0500 Date: Thu, 30 Jan 2014 13:56:52 +0100 From: Andrew Jones Message-ID: <20140130125651.GA5748@hawk.usersys.redhat.com> References: <1391008794-18777-1-git-send-email-drjones@redhat.com> <87mwidvdtg.fsf@pixel.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mwidvdtg.fsf@pixel.localdomain> Subject: Re: [Qemu-devel] [PATCH v3] virtio: Introduce virtio-testdev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mike Day Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, christoffer.dall@linaro.org, kvmarm@lists.cs.columbia.edu On Thu, Jan 30, 2014 at 07:44:59AM -0500, Mike Day wrote: > > Andrew Jones writes: > > > This is a virtio version of hw/misc/debugexit and should evolve into a > > virtio version of pc-testdev. pc-testdev uses the PC's ISA bus, whereas > > this testdev can be plugged into a virtio-mmio transport, which is > > needed for kvm-unit-tests/arm. virtio-testdev uses the virtio device > > config space as a communication channel, and implements an RTAS-like > > protocol through it allowing guests to execute commands. Only three > > commands are currently implemented; > > 1) VERSION: for version compatibility checks > > 2) CLEAR: set all the config space back to zero > > 3) EXIT: exit() from qemu with a status code > > > +static uint32_t virtio_testdev_get_features(VirtIODevice *vdev, uint32_t f) > > +{ > > + return f; > > +} > > + > > Is this meant to be a stub currently? > Something like that. *_get_features() must be supplied by all virtio devices. Just returning the requested features, f, rather than zero, is how virtio-rng does it. So I went that way too. drew