From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqtTS-0001ea-0O for qemu-devel@nongnu.org; Thu, 24 Sep 2009 14:55:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqtTN-0001bn-8t for qemu-devel@nongnu.org; Thu, 24 Sep 2009 14:55:25 -0400 Received: from [199.232.76.173] (port=60654 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqtTM-0001be-NF for qemu-devel@nongnu.org; Thu, 24 Sep 2009 14:55:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22834) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqtTM-0007fl-21 for qemu-devel@nongnu.org; Thu, 24 Sep 2009 14:55:20 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8OItJ6v018178 for ; Thu, 24 Sep 2009 14:55:19 -0400 Subject: Re: [Qemu-devel] [PATCH 08/13] qdev: device free fixups. References: <1253611767-6483-1-git-send-email-kraxel@redhat.com> <1253611767-6483-9-git-send-email-kraxel@redhat.com> From: Markus Armbruster Date: Thu, 24 Sep 2009 20:55:17 +0200 In-Reply-To: <1253611767-6483-9-git-send-email-kraxel@redhat.com> (Gerd Hoffmann's message of "Tue\, 22 Sep 2009 11\:29\:22 +0200") Message-ID: <87hbusb2ay.fsf@pike.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Gerd Hoffmann writes: > Two bug fixes: > * When freeing a device we unregister stuff unconditionally, > even in case we didn't register in the first place because > the ->init() callback failed. > * When freeing a device with child busses attached we don't > zap the child bus (and the devices attached to it). > > Signed-off-by: Gerd Hoffmann Maybe I'm just having a particularly dense day, but I misread this as "this is what the fix does". In reality, it's "this is what we did wrong". Careless readers like me can be kept on track by emphasizing the "wrongness" of what's being done, so that it's (more) obvious we're talking about the bug and not the fix: * When freeing a device we unregister even stuff we didn't register in the first place because the ->init() callback failed. * When freeing a device with child busses attached, we fail to zap the child bus (and the devices attached to it). Another language trick is to use past tense for the bug and present tense for the fix.