From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian =?iso-8859-1?q?Borntr=E4ger?= Subject: Re: [PATCH/RFC] virtio_test: A module for testing virtio via userspace Date: Wed, 24 Jun 2009 13:06:40 +0200 Message-ID: <200906241306.40905.borntraeger@de.ibm.com> References: <200906190927.34831.borntraeger@de.ibm.com> <200906241310.35016.rusty@rustcorp.com.au> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Tim Hofmann , Christian Ehrhardt , Adrian Schneider , "virtualization@lists.linux-foundation.org" , KVM list To: Rusty Russell Return-path: Received: from mtagate3.de.ibm.com ([195.212.29.152]:60664 "EHLO mtagate3.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751349AbZFXLGk (ORCPT ); Wed, 24 Jun 2009 07:06:40 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.14.3/8.13.8) with ESMTP id n5OB6hUe180682 for ; Wed, 24 Jun 2009 11:06:43 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n5OB6gEo3506372 for ; Wed, 24 Jun 2009 13:06:42 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n5OB6fRM031496 for ; Wed, 24 Jun 2009 13:06:42 +0200 In-Reply-To: <200906241310.35016.rusty@rustcorp.com.au> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Am Mittwoch 24 Juni 2009 05:40:34 schrieb Rusty Russell: > > o the general idea of a virtio_test module > > o the user interface ioctls > > o further ideas and comments > > Not mugging real drivers would be a requirement, I think. Ok, I try to find a proper way to avoid that virtio_test binds to devices that have real drivers available. That patch to virtio_dev_match should be relatively easy. The open question I have: Should virtio_test bind to a device if no other driver is (yet) available? > > +config VIRTIO_TEST > > + tristate "Virtio test driver (EXPERIMENTAL)" > > + select VIRTIO > > + select VIRTIO_RING > > Perhaps these should be depends? Plus, depends on EXPERIMENTAL. > > > + If unsure, say M. > > That's "N" I think. Yes. > > > + case VIOTEST_IOCGETBUF: > > + ret = do_get_buf(vtest, (struct viotest_getbuf __user *) arg); > > + break; > > + case VIOTEST_IOCGETCBS: > > + ret = get_callbacks(vtest, (struct viotest_cbinfo __user *) arg); > > + break; > > Generally the point of callbacks is to tell you you have new buffers; in > fact you're insulated from callbacks which don't show new buffers. So I'm > not sure these two need to be separate? > In which case, a read/write interface starts to make sense (write for > addbuf and kick, read for get_buf). That fits nicely with O_NONBLOCK and > poll(). Hmm - makes sense. I will try to propose a 2nd version of the interface. The interface must handle multiple virtqueues per device, should allow non-blocking mode etc. Lets see what ideas come to my mind. Thanks for the comments Christian