All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Lalancette <clalance@redhat.com>
To: virtualization@lists.linux-foundation.org
Cc: kvm@vger.kernel.org
Subject: [Fwd: [PATCH]: Fix silly output for virtio devices in /proc/interrupts]
Date: Wed, 21 May 2008 15:13:05 +0200	[thread overview]
Message-ID: <48341FE1.4070305@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 35 bytes --]

(sent to the kvm list erroneously)

[-- Attachment #2: [PATCH]: Fix silly output for virtio devices in /proc/interrupts.eml --]
[-- Type: message/rfc822, Size: 4544 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 289 bytes --]

register_virtio_device() is doing something silly by overwriting what the caller
put into .bus_id.  This causes the interrupt line for all virtio devices to show
up as "0", "1", etc. in /proc/interrupts.  The attached patch fixes it.

Signed-off-by: Chris Lalancette <clalance@redhat.com>

[-- Attachment #2.1.2: virtio-blk-fix-proc-interrupts.patch --]
[-- Type: text/x-patch, Size: 1060 bytes --]

commit cb97605728fc1d7a15ddc6ab689e8bcd23871133
Author: Chris Lalancette <clalance@redhat.com>
Date:   Thu May 15 09:04:55 2008 -0400

    register_virtio_device was doing something silly, in that it was overwriting
    what the calling driver stuck into .bus_id" for the name.  This caused
    problems in the output of /proc/interrupts, since when you request_irq(),
    it doesn't actually copy the devname you pass in but just stores a pointer
    to the data.  The fix is to just not have register_virtio_device do anything
    with the bus_id, and assume the higher level driver set it up properly.

diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index 138a7f0..1556ac2 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -128,7 +128,6 @@ int register_virtio_device(struct virtio_device *dev)
 	int err;
 
 	dev->dev.bus = &virtio_bus;
-	sprintf(dev->dev.bus_id, "%u", dev->index);
 
 	/* We always start by resetting the device, in case a previous
 	 * driver messed it up.  This also tests that code path a little. */

[-- Attachment #3: Type: text/plain, Size: 184 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization

             reply	other threads:[~2008-05-21 13:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-21 13:13 Chris Lalancette [this message]
2008-05-22 12:38 ` [Fwd: [PATCH]: Fix silly output for virtio devices in /proc/interrupts] Rusty Russell
2008-05-22 12:38 ` Rusty Russell
2008-05-22 12:51   ` Chris Lalancette
2008-05-22 12:51   ` Chris Lalancette
2008-05-22 13:38   ` Christian Borntraeger
2008-05-22 13:38   ` Christian Borntraeger
2008-05-22 21:58   ` Anthony Liguori
2008-05-22 21:58   ` Anthony Liguori
2008-05-23  2:43     ` Rusty Russell
2008-05-23  2:43     ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48341FE1.4070305@redhat.com \
    --to=clalance@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.