All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 3/7] qdev-monitor: Stop error avalance in qbus_find_recursive()
Date: Fri, 19 Jun 2015 15:19:17 +0200	[thread overview]
Message-ID: <87vbejn8dm.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <55840F46.7000009@suse.de> ("Andreas Färber"'s message of "Fri, 19 Jun 2015 14:47:02 +0200")

Andreas Färber <afaerber@suse.de> writes:

> Did you mean avalanche?

Yes, fixing...

> Am 13.06.2015 um 13:18 schrieb Markus Armbruster:
>> Reproducer:
>> 
>>     $ qemu-system-x86_64 -nodefaults -device virtio-rng-pci -device virtio-rng-pci -device virtio-rng-device,bus=virtio-bus
>>     qemu-system-x86_64: -device virtio-rng-device,bus=virtio-bus: Bus 'virtio-bus' is full
>>     qemu-system-x86_64: -device virtio-rng-device,bus=virtio-bus: Bus 'virtio-bus' is full
>>     qemu-system-x86_64: -device virtio-rng-device,bus=virtio-bus: Bus 'virtio-bus' not found
>> 
>> qbus_find_recursive() reports the "is full" error itself, and leaves
>> reporting "not found" to its caller.  The result is confusion.  Write
>> it a function contract that permits leaving all error reporting to the
>> caller, and implement it.  Update callers to detect and report "is
>> full".
>> 
>> Screwed up when commit 1395af6 added the max_dev limit and the "is
>> full" error condition to enforce it.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>> ---
>>  qdev-monitor.c | 62 ++++++++++++++++++++++++++++++++++++----------------------
>>  1 file changed, 39 insertions(+), 23 deletions(-)
>> 
>> diff --git a/qdev-monitor.c b/qdev-monitor.c
>> index 7dd62dd..1408c86 100644
>> --- a/qdev-monitor.c
>> +++ b/qdev-monitor.c
>> @@ -364,43 +364,55 @@ static DeviceState *qbus_find_dev(BusState *bus, char *elem)
>>      return NULL;
>>  }
>>  
>> +static inline bool qbus_is_full(BusState *bus)
>> +{
>> +    BusClass *bus_class = BUS_GET_CLASS(bus);
>> +    return bus_class->max_dev && bus->max_index >= bus_class->max_dev;
>> +}
>> +
>> +/**
>
> This should probably just be "/*".

Fixing...

> I'll trust you on getting the functional logic right, can't do a full
> review right now.

Thank you all the same!

  reply	other threads:[~2015-06-19 13:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-13 11:18 [Qemu-devel] [PATCH v2 0/7] qdev: Mostly wean off QError Markus Armbruster
2015-06-13 11:18 ` [Qemu-devel] [PATCH v2 1/7] qdev: Deprecated qdev_init() is finally unused, drop Markus Armbruster
2015-06-19 12:36   ` Andreas Färber
2015-06-19 13:17     ` Markus Armbruster
2015-06-13 11:18 ` [Qemu-devel] [PATCH v2 2/7] qdev: Un-deprecate qdev_init_nofail() Markus Armbruster
2015-06-19 12:42   ` Andreas Färber
2015-06-19 13:18     ` Markus Armbruster
2015-06-13 11:18 ` [Qemu-devel] [PATCH v2 3/7] qdev-monitor: Stop error avalance in qbus_find_recursive() Markus Armbruster
2015-06-19 12:47   ` Andreas Färber
2015-06-19 13:19     ` Markus Armbruster [this message]
2015-06-13 11:18 ` [Qemu-devel] [PATCH v2 4/7] qdev-monitor: Fix check for full bus Markus Armbruster
2015-06-13 11:18 ` [Qemu-devel] [PATCH v2 5/7] qdev-monitor: Convert qbus_find() to Error Markus Armbruster
2015-06-13 11:18 ` [Qemu-devel] [PATCH v2 6/7] qdev-monitor: Propagate errors through set_property() Markus Armbruster
2015-06-19 12:49   ` Andreas Färber
2015-06-13 11:18 ` [Qemu-devel] [PATCH v2 7/7] qdev-monitor: Propagate errors through qdev_device_add() Markus Armbruster
2015-06-19 13:08   ` Andreas Färber
2015-06-19 13:49     ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vbejn8dm.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=afaerber@suse.de \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.