kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark McLoughlin <markmc@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	kvm <kvm@vger.kernel.org>, Jiri Slaby <jirislaby@gmail.com>,
	Greg KH <gregkh@suse.de>
Subject: Re: [PATCH 2/2] virtio: do not statically allocate root device
Date: Mon, 08 Dec 2008 14:58:53 +0000	[thread overview]
Message-ID: <1228748333.3609.47.camel@blaa> (raw)
In-Reply-To: <493D3276.5040506@us.ibm.com>

On Mon, 2008-12-08 at 08:43 -0600, Anthony Liguori wrote:
> Mark McLoughlin wrote:
> > Apparently we shouldn't be statically allocating the root device
> > object, so dynamically allocate it instead.
> >
> > Also add a release() function to avoid this warning:
> >
> >   Device 'virtio-pci' does not have a release() function, it is broken and must be fixed
> >   
> 
> Is it really better to dynamically allocate the root device than 
> statically allocate it?  Is the advice that we shouldn't statically 
> allocate a device really a suggestion that if you're doing that, you're 
> using struct device wrong?

There are other statically allocated devices in tree[1]. It seems this
is actively discouraged, though.

AFAICT, the platform_bus device is there for a similar reason to ours -
i.e. to group devices together in sysfs.

> If so, this conversion should be equally wrong.  Have you chosen to keep 
> this device so that your initrd work-around continues to work as-is?  

I choose to keep it because:

  a) I'm trying to fix the warning spew from 'rmmod virtio_pci' without 
     breaking anything else

  b) The grouping under /sys/devices/{virtio-pci,lguest,kvm_s390} is
     useful IMHO and there are precedents (e.g. /sys/devices/platform)

  c) It's better to not gratuitously move stuff around where we know it 
     will break something

> What exactly is the work around and is there a less hackish way we could 
> support it?

Being discussed elsewhere in the thread.

Cheers,
Mark.

[1] - git-grep 'struct device .* = {' next-20081204
next-20081204:arch/cris/arch-v32/drivers/iop_fw_load.c:static struct device iop_spu_device[2] = {
next-20081204:arch/cris/arch-v32/drivers/iop_fw_load.c:static struct device iop_mpu_device = {
next-20081204:arch/ia64/kernel/pci-dma.c:struct device fallback_dev = {
next-20081204:arch/parisc/kernel/drivers.c:static struct device root = {
next-20081204:arch/powerpc/kernel/ibmebus.c:static struct device ibmebus_bus_device = { /* fake "parent" device */
next-20081204:arch/powerpc/platforms/ps3/system-bus.c:static struct device ps3_system_bus = {
next-20081204:arch/x86/kernel/pci-dma.c:struct device x86_dma_fallback_dev = {
next-20081204:drivers/base/isa.c:static struct device isa_bus = {
next-20081204:drivers/base/platform.c:struct device platform_bus = {
next-20081204:drivers/idle/i7300_idle.c:static struct device dummy_dma_dev = {
next-20081204:drivers/ieee1394/nodemgr.c:static struct device nodemgr_dev_template_ud = {
next-20081204:drivers/ieee1394/nodemgr.c:static struct device nodemgr_dev_template_ne = {
next-20081204:drivers/ieee1394/nodemgr.c:struct device nodemgr_dev_template_host = {
next-20081204:drivers/lguest/lguest_device.c:static struct device lguest_root = {
next-20081204:drivers/misc/sgi-gru/grumain.c:static struct device gru_device = {
next-20081204:drivers/misc/sgi-xp/xp_main.c:struct device xp_dbg_subname = {
next-20081204:drivers/misc/sgi-xp/xpc_main.c:struct device xpc_part_dbg_subname = {
next-20081204:drivers/misc/sgi-xp/xpc_main.c:struct device xpc_chan_dbg_subname = {
next-20081204:drivers/misc/sgi-xp/xpnet.c:struct device xpnet_dbg_subname = {
...
next-20081204:drivers/rapidio/rio-driver.c:static struct device rio_bus = {
next-20081204:drivers/scsi/scsi_debug.c:static struct device pseudo_primary = {
next-20081204:drivers/sh/maple/maple.c:static struct device maple_bus = {
next-20081204:drivers/sh/superhyway/superhyway.c:static struct device superhyway_bus_device = {
next-20081204:drivers/virtio/virtio_pci.c:static struct device virtio_pci_root = {
next-20081204:drivers/w1/w1.c:struct device w1_master_device = {
next-20081204:drivers/w1/w1.c:struct device w1_slave_device = {
next-20081204:samples/firmware_class/firmware_sample_driver.c:static struct device ghost_device = {
next-20081204:samples/firmware_class/firmware_sample_firmware_class.c:static struct device my_device = {



  reply	other threads:[~2008-12-08 15:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-04 12:44 [PATCH] virtio: make PCI devices take a virtio_pci module ref Mark McLoughlin
2008-12-04 22:46 ` Jiri Slaby
2008-12-05  9:02   ` Michael Tokarev
2008-12-05 13:17     ` Jiri Slaby
2008-12-05 14:55       ` Mark McLoughlin
2008-12-05 15:25         ` Jiri Slaby
2008-12-05 15:26           ` Greg KH
2008-12-05 18:30             ` Mark McLoughlin
2008-12-05 18:46               ` Greg KH
2008-12-08 11:49                 ` [PATCH 1/2] virtio: add PCI device release() function Mark McLoughlin
2008-12-08 11:49                   ` [PATCH 2/2] virtio: do not statically allocate root device Mark McLoughlin
2008-12-08 14:43                     ` Anthony Liguori
2008-12-08 14:58                       ` Mark McLoughlin [this message]
2008-12-05 18:33           ` [PATCH] virtio: make PCI devices take a virtio_pci module ref Mark McLoughlin
2008-12-05 15:43         ` Anthony Liguori
2008-12-05 17:22           ` Jiri Slaby
2008-12-05 18:36           ` Mark McLoughlin
2008-12-05 18:54             ` Anthony Liguori
2008-12-07  8:30       ` Rusty Russell
2008-12-07 13:36         ` Jiri Slaby
2008-12-05  0:13 ` Rusty Russell
2008-12-05 15:07   ` Mark McLoughlin
2008-12-07  8:22     ` Rusty Russell
2008-12-08 13:03       ` Mark McLoughlin
2008-12-08 14:46         ` Anthony Liguori
2008-12-09 16:41           ` Mark McLoughlin
2008-12-09 16:57             ` Anthony Liguori
2008-12-09 18:16             ` Kay Sievers
2008-12-10  9:49               ` Mark McLoughlin
2008-12-10 12:02                 ` Kay Sievers
2008-12-09 22:25   ` Jesse Barnes

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=1228748333.3609.47.camel@blaa \
    --to=markmc@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=gregkh@suse.de \
    --cc=jirislaby@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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;
as well as URLs for NNTP newsgroup(s).