From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [Fwd: [PATCH]: Fix silly output for virtio devices in /proc/interrupts] Date: Thu, 22 May 2008 22:38:57 +1000 Message-ID: <200805222238.58166.rusty@rustcorp.com.au> References: <48341FE1.4070305@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, Christian Borntraeger , Martin Schwidefsky , Carsten Otte , Heiko Carstens To: Chris Lalancette Return-path: Received: from ozlabs.org ([203.10.76.45]:35428 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760006AbYEVMjV convert rfc822-to-8bit (ORCPT ); Thu, 22 May 2008 08:39:21 -0400 In-Reply-To: <48341FE1.4070305@redhat.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Wednesday 21 May 2008 23:13:05 Chris Lalancette wrote: > Author: Chris Lalancette > Date: =C2=A0 Thu May 15 09:04:55 2008 -0400 > > =C2=A0 =C2=A0 register_virtio_device was doing something silly, in th= at it was > overwriting what the calling driver stuck into .bus_id" for the name.= =C2=A0This > caused problems in the output of /proc/interrupts, since when you > request_irq(), it doesn't actually copy the devname you pass in but j= ust > stores a pointer to the data. =C2=A0The fix is to just not have > register_virtio_device do anything with the bus_id, and assume the hi= gher > level driver set it up properly. OK, but only one higher-level driver will set it up properly: kvm. Nei= ther lguest nor s/390 do this, and as a result, they fail to register *any* devices. The following patch should fix it for s/390 (it's identical to the lgue= st patch), but would prefer testing (S/390-ers cc'd). =3D=3D=3D virtio: S/390 set name of virtio devices directly. Chris has a patch 'Fix silly output for virtio devices in /proc/interru= pts' which requires callers to the virtio driver infrastructure to set the b= us_ids themselves. This does that for s/390. Signed-off-by: Rusty Russell Cc: Christian Borntraeger Cc: Martin Schwidefsky Cc: Carsten Otte Cc: Heiko Carstens Cc: Chris Lalancette --- drivers/s390/kvm/kvm_virtio.c | 2 ++ 1 file changed, 2 insertions(+) diff -r c903ef6b391f drivers/s390/kvm/kvm_virtio.c --- a/drivers/s390/kvm/kvm_virtio.c Thu May 22 22:31:31 2008 +1000 +++ b/drivers/s390/kvm/kvm_virtio.c Thu May 22 22:32:55 2008 +1000 @@ -265,6 +265,8 @@ static void add_kvm_device(struct kvm_de =20 kdev->vdev.dev.parent =3D &kvm_root; kdev->vdev.index =3D dev_index++; + snprintf(kdev->vdev.dev.bus_id, BUS_ID_SIZE, "virtio%d", + kdev->vdev.index); kdev->vdev.id.device =3D d->type; kdev->vdev.config =3D &kvm_vq_configspace_ops; kdev->desc =3D d;