From 9b2aa84f87f5b95cb0295dcae38fbfbf115df2be Mon Sep 17 00:00:00 2001 From: Alberto Garcia Date: Wed, 8 Apr 2015 12:29:18 +0300 Subject: block: add bdrv_get_device_or_node_name() This function gets the device name associated with a BlockDriverState, or its node name if the device name is empty. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Eric Blake Message-id: 4fa30aa8d61d9052ce266fd5429a59a14e941255.1428485266.git.berto@igalia.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/quorum.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'block/quorum.c') diff --git a/block/quorum.c b/block/quorum.c index 437b12251d..f91ef75a84 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -226,10 +226,7 @@ static void quorum_report_bad(QuorumAIOCB *acb, char *node_name, int ret) static void quorum_report_failure(QuorumAIOCB *acb) { - const char *reference = bdrv_get_device_name(acb->common.bs)[0] ? - bdrv_get_device_name(acb->common.bs) : - acb->common.bs->node_name; - + const char *reference = bdrv_get_device_or_node_name(acb->common.bs); qapi_event_send_quorum_failure(reference, acb->sector_num, acb->nb_sectors, &error_abort); } -- cgit v1.2.3