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>
This commit is contained in:
Richard W.M. Jones 2013-06-10 12:38:43 +01:00 committed by Kevin Wolf
parent cede621ffc
commit a7cea2ba47

View 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)) {