qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: do not allow read-only=on and snapshot=on to be used together
@ 2014-01-14 19:12 Jeff Cody
  2014-01-14 19:30 ` Eric Blake
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Jeff Cody @ 2014-01-14 19:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini, stefanha

Having both read-only=on and snapshot=on together does not make sense;
currently, the read-only argument is effectively ignored for the
temporary snapshot.  To prevent confusion, disallow the usage of both
'snapshot=on' and 'read-only=on'.

Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 blockdev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/blockdev.c b/blockdev.c
index e457494..845ff8a 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -352,6 +352,13 @@ static DriveInfo *blockdev_init(QDict *bs_opts,
     /* extract parameters */
     snapshot = qemu_opt_get_bool(opts, "snapshot", 0);
     ro = qemu_opt_get_bool(opts, "read-only", 0);
+
+    /* having ro and snapshot together does not make sense */
+    if (ro && snapshot) {
+        error_setg(errp, "invalid option combination: read-only and snapshot");
+        goto early_err;
+    }
+
     copy_on_read = qemu_opt_get_bool(opts, "copy-on-read", false);
 
     file = qemu_opt_get(opts, "file");
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-03-14 12:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-14 19:12 [Qemu-devel] [PATCH] block: do not allow read-only=on and snapshot=on to be used together Jeff Cody
2014-01-14 19:30 ` Eric Blake
2014-01-16  7:00 ` Stefan Hajnoczi
2014-01-16  9:39 ` Kevin Wolf
2014-01-16 19:20   ` Jeff Cody
2014-01-17 17:01     ` Kevin Wolf
2014-01-24 13:33 ` Kevin Wolf
2014-01-24 13:48   ` Jeff Cody
2014-03-12 11:16     ` Kevin Wolf
2014-03-14 12:40       ` Jeff Cody

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