From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYgFk-0003vv-Ar for qemu-devel@nongnu.org; Thu, 19 Mar 2015 15:37:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYgFh-0000T4-4b for qemu-devel@nongnu.org; Thu, 19 Mar 2015 15:37:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYgFg-0000Sz-TN for qemu-devel@nongnu.org; Thu, 19 Mar 2015 15:37:09 -0400 Message-ID: <550B2562.4090506@redhat.com> Date: Thu, 19 Mar 2015 15:37:06 -0400 From: Max Reitz MIME-Version: 1.0 References: <5ad1c53c8b0dad6347d66af08e44c2faadff8612.1426779661.git.berto@igalia.com> In-Reply-To: <5ad1c53c8b0dad6347d66af08e44c2faadff8612.1426779661.git.berto@igalia.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] block: use bdrv_get_device_or_node_name() in error messages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi On 2015-03-19 at 11:43, Alberto Garcia wrote: > There are several error messages that identify a BlockDriverState by > its device name. However those errors can be produced in nodes that > don't have a device name associated. > > In those cases we should use bdrv_get_device_or_node_name() to fall > back to the node name and produce a more meaningful message. > > Signed-off-by: Alberto Garcia > --- > block.c | 13 +++++++------ > block/qcow.c | 4 ++-- > block/qcow2.c | 2 +- > block/qed.c | 2 +- > block/vdi.c | 2 +- > block/vhdx.c | 2 +- > block/vmdk.c | 4 ++-- > block/vpc.c | 2 +- > block/vvfat.c | 3 ++- > 9 files changed, 18 insertions(+), 16 deletions(-) Well, it may pose a problem that the error messages often state "Device '%s'", but with this change, it's not always a device, but sometimes just a node. Maybe it would be better to replace the "Device" in the error messages by "Node" (a node can be specified both by the node name and the device name, whereas a device can only be referenced by its device name). Apart from this, the idea of this change looks good, though, as do the changes done by this patch. Max