diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-05-26 10:44:44 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2010-05-28 13:14:25 +0200 |
commit | dc33bb341122623105573d47fa6d71a0ba5ff15c (patch) | |
tree | 74b3c14938141987fb36f9a4fb4db6a2708580fd | |
parent | b50cbabc1bc12e6b0082089c70015c1b97db86a1 (diff) | |
download | qemu-dc33bb341122623105573d47fa6d71a0ba5ff15c.zip qemu-dc33bb341122623105573d47fa6d71a0ba5ff15c.tar.gz qemu-dc33bb341122623105573d47fa6d71a0ba5ff15c.tar.bz2 |
drive: allow rerror, werror and readonly for if=none
When creating guest disks the qdev way using ...
-drive if=none,id=$name,args
-device $driver,drive=$name
it is not possible to specify rerror, werror and readonly arguments
for drive as drive_init allows/blocks them based on the interface (if=)
specified and none isn't white-listed there.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r-- | vl.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -953,7 +953,7 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque, on_write_error = BLOCK_ERR_STOP_ENOSPC; if ((buf = qemu_opt_get(opts, "werror")) != NULL) { - if (type != IF_IDE && type != IF_SCSI && type != IF_VIRTIO) { + if (type != IF_IDE && type != IF_SCSI && type != IF_VIRTIO && type != IF_NONE) { fprintf(stderr, "werror is no supported by this format\n"); return NULL; } @@ -966,7 +966,7 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque, on_read_error = BLOCK_ERR_REPORT; if ((buf = qemu_opt_get(opts, "rerror")) != NULL) { - if (type != IF_IDE && type != IF_VIRTIO) { + if (type != IF_IDE && type != IF_VIRTIO && type != IF_NONE) { fprintf(stderr, "rerror is no supported by this format\n"); return NULL; } @@ -1114,7 +1114,7 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque, /* CDROM is fine for any interface, don't check. */ ro = 1; } else if (ro == 1) { - if (type != IF_SCSI && type != IF_VIRTIO && type != IF_FLOPPY) { + if (type != IF_SCSI && type != IF_VIRTIO && type != IF_FLOPPY && type != IF_NONE) { fprintf(stderr, "qemu: readonly flag not supported for drive with this interface\n"); return NULL; } |