From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z22tg-00051A-5z for qemu-devel@nongnu.org; Mon, 08 Jun 2015 15:39:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z22tc-0000Rb-Uc for qemu-devel@nongnu.org; Mon, 08 Jun 2015 15:39:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z22tc-0000RP-P7 for qemu-devel@nongnu.org; Mon, 08 Jun 2015 15:39:44 -0400 Message-ID: <5575EF7F.4090300@redhat.com> Date: Mon, 08 Jun 2015 13:39:43 -0600 From: Eric Blake MIME-Version: 1.0 References: <1433789877-6950-1-git-send-email-armbru@redhat.com> <1433789877-6950-5-git-send-email-armbru@redhat.com> In-Reply-To: <1433789877-6950-5-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CKwV67CaNMRnpnxL8XbijRM1vr5gkprmp" Subject: Re: [Qemu-devel] [PATCH 4/7] qdev-monitor: Fix check for full bus List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, afaerber@suse.de, kraxel@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CKwV67CaNMRnpnxL8XbijRM1vr5gkprmp Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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." >=20 > It doesn't always fail when it should: >=20 > $ qemu-system-x86_64 -nodefaults -device virtio-serial-pci -device = virtio-rng-device,bus=3Dpci.0/virtio-serial-pci/virtio-bus >=20 > 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. >=20 > And sometimes fails when it shouldn't: >=20 > $ qemu-system-x86_64 -nodefaults -device virtio-serial-pci -device = virtserialport,bus=3Dvirtio-bus/virtio-serial-device >=20 > 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. >=20 > 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. >=20 > Fix by moving the "bus full" check to right before we return a bus. >=20 > Signed-off-by: Markus Armbruster > --- > qdev-monitor.c | 31 +++++++++++++++++-------------- > 1 file changed, 17 insertions(+), 14 deletions(-) >=20 Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --CKwV67CaNMRnpnxL8XbijRM1vr5gkprmp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVde9/AAoJEKeha0olJ0NqkGEH/jVDvs0tYmx2AvX9JufTRU16 qBP26wvPIOHXNoV31kBTnAUlXonVbcyHHAPLJgVSnr7gtFSeixJTMYfqN33tIR2M jswTguIkPEMP1XltzUuki23Lz48ZZz2vohGH3qBAWsy9fysgSQr7hnzcX9ijoz+m JRPefm35v2QXLBN77tapEFhN1+XNRhxhEuJI9WG6ZdEZ5G4IbLVj5BsidqaQGN0D MZAVkeYYocLbkySLY0YZjQ+Rh0lNL24fr0ICiqydtopEqMEzjJcPTGWOH/HFaXX2 iKcQ/jiEVIQJfhzv9XuNLXCfEb41oH+uiDjicPn3rbzwsNInabNFCEpzvukUNxU= =9sxU -----END PGP SIGNATURE----- --CKwV67CaNMRnpnxL8XbijRM1vr5gkprmp--