qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] address order of virtio-mmio devices


From: Richard W.M. Jones
Subject: Re: [Qemu-devel] address order of virtio-mmio devices
Date: Thu, 29 Jan 2015 19:09:12 +0000
User-agent: Mutt/1.5.20 (2009-12-10)

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 <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]