diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2013-06-10 12:38:43 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-06-17 17:47:59 +0200 |
commit | a7cea2ba47ea6d361584072f96d7858f5cc99009 (patch) | |
tree | 36407d32616e50eab57e9073742e3bc145f51754 /block | |
parent | cede621ffc13ba1e209d9a21e85b21e150b74045 (diff) |
block/curl.c: Refuse to open the handle for writes.
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/curl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/block/curl.c b/block/curl.c index 4dc3b4b71b..0fba451e3b 100644 --- a/block/curl.c +++ b/block/curl.c @@ -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)) { |