[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 19/20] block: do not abuse EMEDIUMTYPE
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH 19/20] block: do not abuse EMEDIUMTYPE |
Date: |
Mon, 10 Feb 2014 16:47:22 +0800 |
User-agent: |
Mutt/1.5.22 (2013-10-16) |
On Sun, 02/09 10:48, Paolo Bonzini wrote:
> diff --git a/block/bochs.c b/block/bochs.c
> index 51d9a90..f0f9a7e 100644
> --- a/block/bochs.c
> +++ b/block/bochs.c
> @@ -129,7 +129,8 @@ static int bochs_open(BlockDriverState *bs, QDict
> *options, int flags,
> strcmp(bochs.subtype, GROWING_TYPE) ||
> ((le32_to_cpu(bochs.version) != HEADER_VERSION) &&
> (le32_to_cpu(bochs.version) != HEADER_V1))) {
> - return -EMEDIUMTYPE;
> + error_setg(errp, "invalid Bochs image header\n");
Ending "\n" is not necessary, including all following cases.
> + return -EINVAL;
> }
>
> if (le32_to_cpu(bochs.version) == HEADER_V1) {
<snip>
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 2da62b8..fa63d37 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -449,7 +449,7 @@ static int qcow2_open(BlockDriverState *bs, QDict
> *options, int flags,
>
> if (header.magic != QCOW_MAGIC) {
> error_setg(errp, "Image is not in qcow2 format");
It might be good to have a consistent message pattern in qcow2 as others. Is it
worth adding a QERR_ error class for unexpected format magic?
Fam
> - ret = -EMEDIUMTYPE;
> + ret = -EINVAL;
> goto fail;
> }
> if (header.version < 2 || header.version > 3) {
- Re: [Qemu-devel] [PATCH 12/20] qed: correctly propagate errors, (continued)
- [Qemu-devel] [PATCH 13/20] vhdx: correctly propagate errors, Paolo Bonzini, 2014/02/09
- [Qemu-devel] [PATCH 15/20] vmdk: extract vmdk_read_desc, Paolo Bonzini, 2014/02/09
- [Qemu-devel] [PATCH 16/20] vmdk: push vmdk_read_desc up to caller, Paolo Bonzini, 2014/02/09
- [Qemu-devel] [PATCH 17/20] vmdk: do not try opening a file as both image and descriptor, Paolo Bonzini, 2014/02/09
- [Qemu-devel] [PATCH 19/20] block: do not abuse EMEDIUMTYPE, Paolo Bonzini, 2014/02/09
- Re: [Qemu-devel] [PATCH 19/20] block: do not abuse EMEDIUMTYPE,
Fam Zheng <=
- [Qemu-devel] [PATCH 20/20] vdi: say why an image is bad, Paolo Bonzini, 2014/02/09
- [Qemu-devel] [PATCH 14/20] vvfat: correctly propagate errors, Paolo Bonzini, 2014/02/09
- [Qemu-devel] [PATCH 18/20] vmdk: correctly propagate errors, Paolo Bonzini, 2014/02/09