qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC 1/2] qbus_find_recursive(): don't abort search for


From: Peter Maydell
Subject: Re: [Qemu-devel] [RFC 1/2] qbus_find_recursive(): don't abort search for named bus on full bus node
Date: Thu, 31 Jan 2013 16:09:43 +0000

On 31 January 2013 16:05, Laszlo Ersek <address@hidden> wrote:
> On 01/31/13 16:52, Peter Maydell wrote:
>> This looks like the wrong fix to this problem -- if the user passed
>> us a specific name to search for and we found it and it was full, then
>> we definitely want to stop here.
>
> You only skip the children, but not the siblings. When you return NULL
> here, the sibling loop one stack frame higher up continues anyway.

Then that's a bug in the caller -- it should actually stop on
error, not plough ahead. [that is, we need to distinguish
"not found" from "found and it won't work" from "found".]

> This function deserves more intrusive changes, but that's usually
> invitation for more bikeshedding, hence I wanted to avoid it. (For
> example, before commit 1395af6f there was no reason to set "match" to
> zero in two independent "if"s, then check "match" in a third "if".) I
> think that a rewrite from scratch would be justified (and frowned upon).

I think refactorings that make the code make more sense are
entirely reasonable.

-- PMM



reply via email to

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