Re: [PATCH v2] Ignore virtio-mmio disks in qemuAssignDevicePCISlots()

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

 



On Wed, Sep 09, 2015 at 11:27:25AM +0300, Pavel Fedin wrote:
> Fixes the following error when attempting to add a disk with bus='virtio'
> to a machine which actually supports virtio-mmio (caught with ARM virt):
> 
> virtio disk cannot have an address of type 'virtio-mmio'
> 
> The problem has been likely introduced by
> e8d55172544c1fafe31a9e09346bdebca4f0d6f9. Before that
> qemuAssignDevicePCISlots() was never called for ARM "virt" machine.
> 

Adding a test case to qemuxml2argvtest would help us prevent that
breakage in the future.

> Signed-off-by: Pavel Fedin <p.fedin@xxxxxxxxxxx>
> ---
> v1 => v2
> - Added check for QEMU_CAPS_DEVICE_VIRTIO_MMIO, this leaves the
>   error message for machines which actually do not support
>   virtio-mmio. In this case the user may still attempt to add
>   such a disk manually.
> ---
>  src/qemu/qemu_command.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index ec5e3d4..db21ee9 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -2598,6 +2598,12 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
>              VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)
>              continue;
>  
> +        /* Also ignore virtio-mmio disks if our machine allows them */
> +        if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO) &&

Please check that both 'make check' and 'make syntax-check' pass with
your patch, as mentioned on our Hacking page:
http://libvirt.org/hacking.html

Jan

> +            def->disks[i]->info.type ==
> +            VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO)
> +            continue;
> +
>          if (def->disks[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
>              virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
>                             _("virtio disk cannot have an address of type '%s'"),
> -- 
> 1.9.5.msysgit.0
> 
> 
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]