From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YETUU-0003dR-1m for qemu-devel@nongnu.org; Thu, 22 Jan 2015 20:56:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YETUQ-0003kn-1I for qemu-devel@nongnu.org; Thu, 22 Jan 2015 20:56:53 -0500 From: Julio Faracco Date: Thu, 22 Jan 2015 23:53:40 -0200 Message-Id: <1421978021-3609-1-git-send-email-jcfaracco@gmail.com> Subject: [Qemu-devel] [PATCH 1/2] qcow2-snapshot: Change filter function to avoid NULL parameter when a snapshot will be created. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, kwolf@redhat.com, Julio Faracco This is a trivial patch to change the filter 'find_snapshot_by_id_and_name' to 'find_snapshot_by_id_or_name'. The field 'Name' is not required. So this change avoid NULL parameters. And use the correct function to filter. Signed-off-by: Julio Faracco --- block/qcow2-snapshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index 5b3903c..c7d4cfe 100644 --- a/block/qcow2-snapshot.c +++ b/block/qcow2-snapshot.c @@ -357,7 +357,7 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info) } /* Check that the ID is unique */ - if (find_snapshot_by_id_and_name(bs, sn_info->id_str, NULL) >= 0) { + if (find_snapshot_by_id_or_name(bs, sn_info->id_str) >= 0) { return -EEXIST; } -- 1.9.1