diff mbox

[1/2] qcow2-snapshot: Change filter function to avoid NULL parameter when a snapshot will be created.

Message ID 1421978021-3609-1-git-send-email-jcfaracco@gmail.com
State New
Headers show

Commit Message

Julio Faracco Jan. 23, 2015, 1:53 a.m. UTC
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 <jcfaracco@gmail.com>
---
 block/qcow2-snapshot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

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;
     }