From: "Richard W.M. Jones" <rjones@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
qemu devel list <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] address order of virtio-mmio devices
Date: Thu, 29 Jan 2015 19:09:12 +0000 [thread overview]
Message-ID: <20150129190912.GB3860@redhat.com> (raw)
In-Reply-To: <54CA7BF5.8020800@redhat.com>
On Thu, Jan 29, 2015 at 07:29:09PM +0100, Laszlo Ersek wrote:
> On 01/29/15 19:15, Peter Maydell wrote:
> > On 29 January 2015 at 17:25, Laszlo Ersek <lersek@redhat.com> wrote:
> >> I find that virtio-mmio devices are assigned highest-to-lowest addresses
> >> as they are found on the command line. IOW, this code (from commit
> >> f5fdcd6e):
> >>
> >> /* Note that we have to create the transports in forwards order
> >> * so that command line devices are inserted lowest address first,
> >> * and then add dtb nodes in reverse order so that they appear in
> >> * the finished device tree lowest address first.
> >> */
> >> for (i = 0; i < NUM_VIRTIO_TRANSPORTS; i++) {
> >> int irq = vbi->irqmap[VIRT_MMIO] + i;
> >> hwaddr base = vbi->memmap[VIRT_MMIO].base + i * size;
> >>
> >> sysbus_create_simple("virtio-mmio", base, pic[irq]);
> >> }
> >>
> >> works exactly in reverse.
> >
> > Note that you can't rely on device ordering anyway. Guests
> > should be using UUIDs or similar to ensure they mount the
> > right filesystems in the right places, because the kernel
> > makes no guarantee that it will enumerate devices in the
> > device tree in any particular order.
>
> Understood. Then we'll probably have to address this in libguestfs.
That's pretty much impossible. If we can't fix qemu, then libguestfs
will need to add the drives in reverse order on the command line (for
this case virtio-blk && -M virt).
I should note that we're only trying to use virtio-blk because
virtio-scsi is broken ... Laszlo: is there a public bug for that?
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW
next prev parent reply other threads:[~2015-01-29 19:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-29 17:25 [Qemu-devel] address order of virtio-mmio devices Laszlo Ersek
2015-01-29 17:59 ` Paolo Bonzini
2015-01-29 18:15 ` Peter Maydell
2015-01-29 18:29 ` Laszlo Ersek
2015-01-29 19:01 ` Peter Maydell
2015-01-29 19:12 ` Laszlo Ersek
2015-01-29 19:47 ` Laszlo Ersek
2015-01-29 20:05 ` Peter Maydell
2015-01-30 9:54 ` Daniel P. Berrange
2015-01-30 10:16 ` Laszlo Ersek
2015-01-30 10:29 ` Peter Maydell
2015-01-30 10:48 ` Daniel P. Berrange
2015-01-30 10:54 ` Peter Maydell
2015-01-30 11:32 ` Peter Maydell
2015-01-30 11:39 ` Laszlo Ersek
2015-01-30 11:42 ` Peter Maydell
2015-01-30 11:38 ` Laszlo Ersek
2015-01-30 11:40 ` Peter Maydell
2015-01-30 11:48 ` Laszlo Ersek
2015-01-30 11:50 ` Peter Maydell
2015-01-29 19:09 ` Richard W.M. Jones [this message]
2015-01-29 19:28 ` Peter Maydell
2015-01-29 19:35 ` Laszlo Ersek
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=20150129190912.GB3860@redhat.com \
--to=rjones@redhat.com \
--cc=lersek@redhat.com \
--cc=peter.maydell@linaro.org \
--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).