[v7,11/13] block/curl.c: Refuse to open the handle for writes.
diff mbox

Message ID 1370499959-8916-12-git-send-email-famz@redhat.com
State New
Headers show

Commit Message

Fam Zheng June 6, 2013, 6:25 a.m. UTC
From: "Richard W.M. Jones" <rjones@redhat.com>

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block/curl.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch
diff mbox

diff --git a/block/curl.c b/block/curl.c
index e067417..bce2e8a 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -454,6 +454,10 @@  static int curl_open(BlockDriverState *bs, QDict *options, int flags)
 
     static int inited = 0;
 
+    if (flags & BDRV_O_RDWR) {
+        return -ENOTSUP;
+    }
+
     opts = qemu_opts_create_nofail(&runtime_opts);
     qemu_opts_absorb_qdict(opts, options, &local_err);
     if (error_is_set(&local_err)) {