All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dor Laor <dor.laor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: kvm-devel
	<kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	virtualization
	<virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>,
	Anthony Liguori
	<aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>,
Subject: [Virtio-for-kvm] [PATCH 12/13] [Mostly resend] virtio additions
Date: Fri, 21 Dec 2007 17:27:04 +0200	[thread overview]
Message-ID: <476BDB48.80700@qumranet.com> (raw)

 From 20a01e0c24f47e9805a88bebc9310163f99b5e99 Mon Sep 17 00:00:00 2001
From: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Date: Sun, 16 Dec 2007 23:35:35 +0200
Subject: [PATCH] Handle module unload Add the device release function.

Signed-off-by: Dor Laor <dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
---
 drivers/virtio/virtio.c     |    7 +++++++
 drivers/virtio/virtio_pci.c |    7 +++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index 303cb6f..212f4e3 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -123,6 +123,11 @@ void unregister_virtio_driver(struct virtio_driver 
*driver)
 }
 EXPORT_SYMBOL_GPL(unregister_virtio_driver);
 
+static void virtio_device_release(struct device *_d)
+{
+    pr_debug("%s\n" , __FUNCTION__);
+}
+
 int register_virtio_device(struct virtio_device *dev)
 {
     int err;
@@ -133,6 +138,8 @@ int register_virtio_device(struct virtio_device *dev)
     /* Acknowledge that we've seen the device. */
     add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE);
 
+
+    dev->dev.release = virtio_device_release;
     /* device_register() causes the bus infrastructure to look for a
      * matching driver. */
     err = device_register(&dev->dev);
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index 7118215..60f2b1f 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -72,12 +72,18 @@ static struct pci_device_id virtio_pci_id_table[] = {
 
 MODULE_DEVICE_TABLE(pci, virtio_pci_id_table);
 
+static void virtio_pci_root_release(struct device *d)
+{
+    pr_debug("%s\n", __FUNCTION__);
+}
+
 /* A PCI device has it's own struct device and so does a virtio device so
  * we create a place for the virtio devices to show up in sysfs.  I 
think it
  * would make more sense for virtio to not insist on having it's own 
device. */
 static struct device virtio_pci_root = {
     .parent        = NULL,
     .bus_id        = "virtio-pci",
+    .release    = virtio_pci_root_release,
 };
 
 /* Unique numbering for devices under the kvm root */
@@ -358,6 +364,7 @@ static void __devexit virtio_pci_remove(struct 
pci_dev *pci_dev)
     pci_iounmap(pci_dev, vp_dev->ioaddr);
     pci_release_regions(pci_dev);
     pci_disable_device(pci_dev);
+    unregister_virtio_device(&vp_dev->vdev);
     kfree(vp_dev);
 }
 
-- 
1.5.3.3


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

             reply	other threads:[~2007-12-21 15:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-21 15:27 Dor Laor [this message]
     [not found] ` <476BDB48.80700-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-24  0:59   ` [Virtio-for-kvm] [PATCH 12/13] [Mostly resend] virtio additions Rusty Russell
2008-01-24  0:59 ` [kvm-devel] " 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=476BDB48.80700@qumranet.com \
    --to=dor.laor-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    --cc=dor.laor-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org \
    --cc=virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.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.