qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/7] qdev-monitor: Fix check for full bus


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 4/7] qdev-monitor: Fix check for full bus
Date: Mon, 08 Jun 2015 13:39:43 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 06/08/2015 12:57 PM, Markus Armbruster wrote:
> Property bus has always been too screwed up to be really usable for
> values other than plain bus IDs.  This just fixes a bug that crept in
> in commit 1395af6 "qdev: add a maximum device allowed field for the
> bus."
> 
> It doesn't always fail when it should:
> 
>     $ qemu-system-x86_64 -nodefaults -device virtio-serial-pci -device 
> virtio-rng-device,bus=pci.0/virtio-serial-pci/virtio-bus
> 
> Happily plugs the virtio-rng-device into the virtio-bus provided by
> virtio-serial-pci, even though its only slot is already occupied by a
> virtio-serial-device.
> 
> And sometimes fails when it shouldn't:
> 
>     $ qemu-system-x86_64 -nodefaults -device virtio-serial-pci -device 
> virtserialport,bus=virtio-bus/virtio-serial-device
> 
> Yes, the virtio-bus is full, but the virtio-serial-bus provided by
> virtio-serial-device isn't, and that's the one we're trying to use.
> 
> Root cause: we check "bus full" when we resolve the first element of
> the path.  That's the correct one only when it's also the last one.
> 
> Fix by moving the "bus full" check to right before we return a bus.
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  qdev-monitor.c | 31 +++++++++++++++++--------------
>  1 file changed, 17 insertions(+), 14 deletions(-)
> 

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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