mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takuma Umeya <tumeya@redhat.com>
To: virtualization@lists.linux-foundation.org
Cc: Stephen Hemminger <shemminger@vyatta.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] virtio: decrement dev_index when device is unregistered
Date: Tue, 5 Apr 2011 00:49:26 -0400 (EDT)	[thread overview]
Message-ID: <66015840.659833.1301978966706.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> (raw)
In-Reply-To: <1457566934.641329.1301903526622.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>

When virtio device is removed, dev_index does not get decremented. 
The next device hotplug event results in consuming the next pci to 
the one that is suppose to be available. 

Signed-off-by: Takuma Umeya <tumeya@redhat.com>

diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index efb35aa..67fe71d 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -216,6 +216,7 @@ EXPORT_SYMBOL_GPL(register_virtio_device);
 void unregister_virtio_device(struct virtio_device *dev)
 {
        device_unregister(&dev->dev);
+       dev_index--;
 }
 EXPORT_SYMBOL_GPL(unregister_virtio_device);
 

-- 
Umeya, Takuma
Technical Account Manager
Red Hat GSS APAC
+81.3.5798.8584 (direct)
tumeya@redhat.com

       reply	other threads:[~2011-04-05  4:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1457566934.641329.1301903526622.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>
2011-04-05  4:49 ` Takuma Umeya [this message]
2011-04-05  6:21   ` Stefan Hajnoczi
2011-04-11  9:11     ` Takuma Umeya
2011-04-12  9:09       ` Stefan Hajnoczi

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=66015840.659833.1301978966706.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com \
    --to=tumeya@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=shemminger@vyatta.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®