On Wed, Sep 09, 2015 at 09:38:44AM +0300, Pavel Fedin wrote:
Hello!
> How did you manage to do that?
Probably i forgot to explicitly specify that it affects ARM 'virt' machine.
Before we added PCIe
support we were able to use only virtio-mmio there. Now we can use both, because
virtio-mmio support
in qemu didn't go anywhere.
It worked before PCIe support introduction just because qemuAssignDevicePCISlots() was
never
called.
OK, good that I tried it on an arm machine :)
> I think we are not handlind virtio-mmio addressing properly as
we won't add some controller qemu
> will then be missing. Shouldn't that be fixed as well?
Didn't understand exactly what you mean, but <address
type='virtio-mmio'/> perfectly works. Even
more, this is the default on ARM for backwards compatibility, as we decided before.
virtio-mmio is
assigned either manually or automatically for certain device kinds by
qemuDomainAssignARMVirtioMMIOAddresses(). After it, qemuDomainAssignPCIAddresses() is
called, which
before PCIe introduction just did nothing. Now it tries to assign PCI addresses to
anything which
still doesn't have addresses at all. For the majority of devices it checks only for
info.type !=
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE, but for VirtIO disks it is a bit more picky for some
reason.
The problem is easy to reproduce with virt-manager. Just try to add a disk (or modify
existing
disk) and specify bus = virtio. By default, since we now have PCIe, it will add
virtio-scsi disk on
top of SCSI controller, so the default works flawlessly. Because virtio-scsi !=
virtio-block.
So that's what I was missing. virt-manager probably automatically
adds the controller, but libvirt itself doesn't. That's what I meant
that we should probably add that too (see *Add*Maybe() functions), but
that's not to be done in this patch, though.
> And isn't virtio-mmio only supported on some platforms?
Yes. But for platforms where virtio-mmio is not supported we can not get
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO addresses, because
qemuDomainAssignARMVirtioMMIOAddresses() will not do anything, because
QEMU_CAPS_DEVICE_VIRTIO_MMIO
will not be set.
Well, without your patch, I get a clear message for non-arm
(e.g. x86_64) machine that says "virtio disk cannot have an address of
type 'virtio-mmio'" (even though I have en_GB locale in which the
string should be very badly translated, but that's another problem).
And that is what we should keep for architectures without virtio-mmio
support, shouldn't we?
Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia