qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Julio Faracco <jcfaracco@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, kwolf@redhat.com,
	Julio Faracco <jcfaracco@gmail.com>
Subject: [Qemu-devel] [PATCH 1/2] qcow2-snapshot: Change filter function to avoid NULL parameter when a snapshot will be created.
Date: Thu, 22 Jan 2015 23:53:40 -0200	[thread overview]
Message-ID: <1421978021-3609-1-git-send-email-jcfaracco@gmail.com> (raw)

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

             reply	other threads:[~2015-01-23  1:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23  1:53 Julio Faracco [this message]
2015-01-23  1:53 ` [Qemu-devel] [PATCH 2/2] qcow2-snapshot: Fixing bug of creating snapshots with the same name Julio Faracco
2015-01-23 15:21   ` Max Reitz
2015-01-27 16:42     ` Julio Faracco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421978021-3609-1-git-send-email-jcfaracco@gmail.com \
    --to=jcfaracco@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).