]> git.proxmox.com Git - qemu.git/blobdiff - block/curl.c
block/curl.c: Refuse to open the handle for writes.
[qemu.git] / block / curl.c
index 4dc3b4b71b13e74a7f510040048ea6d393bff708..0fba451e3b61f5d0a7557d0716967dd8fd85ee3b 100644 (file)
@@ -406,6 +406,12 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags)
 
     static int inited = 0;
 
+    if (flags & BDRV_O_RDWR) {
+        qerror_report(ERROR_CLASS_GENERIC_ERROR,
+                      "curl block device does not support writes");
+        return -EROFS;
+    }
+
     opts = qemu_opts_create_nofail(&runtime_opts);
     qemu_opts_absorb_qdict(opts, options, &local_err);
     if (error_is_set(&local_err)) {