From: Jocelyn Mayer <l_indien@magic.fr>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] allow setting static devfn values for pci devices from the command line
Date: Mon, 19 Nov 2007 19:36:28 +0100 [thread overview]
Message-ID: <1195497388.31632.31.camel@jma4.dev.netgem.com> (raw)
In-Reply-To: <4741BF78.1040502@qumranet.com>
On Mon, 2007-11-19 at 18:53 +0200, Izik Eidus wrote:
> Izik Eidus wrote:
> > hi,
> > this patch make it possible to define from the command line a static
> > devfn value for each pci
> > device.
> > it was wrote for addressing a problem that right now qemu devices get
> > their devfn in random way
> > (almost random)
> > the problem with this is that with adding and removing devices some
> > devfn values can be changed
> > for each device.
> > this make (at least) windows unable to understand what happned to your
> > device and mark it
> > in yellow color. (and will want you to reinstall it)
> >
> > in this patch i simply use the device name that was registred with the
> > pci device registration
> > function.
> > in case you have few devices from the same type (same name), it will
> > simply increase each by one
> > so in this case all you have to do is give long enough offset for the
> > devfns from each other.
> >
> > thanks
> ok here is a fix to two issues that i noticed:
> 1.in one place i declared static_devfns[MAX_PCI_DEVICS][64] and in other
> place: static_devfns[MAX_PCI_DEVICS][128]
>
> 2.in one place i did a calculation on a pointer line before i checked if
> it is vaild pointer...
>
> anyway here it is again and fixed.
It seems that you cannot impose the PCI device numbers mapping, which is
likely to be architecture dependant. What you could however change is
the PCI bus & slot the device is inserted into, the same way you can
choose the PCI slot you put a PCI card into on a real machine. The
architecture could then determine what is the corresponding PCI device
number, given this PCI bus & slot numbers.
For other PCI devices, like PCI bridges or other internal devices, the
PCI slots / devfn are fixed by the architecture. You cannot change them
in any way, then it seems pointless to have an option that would change
the behavior for any of those devices.
The last problem I see is that it seems very ugly to hardcode the device
names the way you did in vl.c. This is even false in most cases, as most
of those devices are only available for a few machines and are not
tunable at all (for example macio or uninorth are only available in some
Apple Mac machines, not even all).
--
Jocelyn Mayer <l_indien@magic.fr>
next prev parent reply other threads:[~2007-11-19 18:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-19 15:51 [Qemu-devel] [PATCH] allow setting static devfn values for pci devices from the command line Izik Eidus
2007-11-19 16:53 ` Izik Eidus
2007-11-19 18:36 ` Jocelyn Mayer [this message]
2007-11-20 8:23 ` Izik Eidus
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=1195497388.31632.31.camel@jma4.dev.netgem.com \
--to=l_indien@magic.fr \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).