* [Qemu-devel] [PATCH] block/vhdx: Error checking fixes
@ 2014-01-29 17:05 Markus Armbruster
2014-01-29 17:14 ` Jeff Cody
2014-01-30 9:34 ` Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: Markus Armbruster @ 2014-01-29 17:05 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, jcody, stefanha
Errors are inadvertently ignored in a few places. Has always been
broken. Spotted by Coverity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
block/vhdx-log.c | 4 ++--
block/vhdx.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/block/vhdx-log.c b/block/vhdx-log.c
index 8c9ae0d..02755b8 100644
--- a/block/vhdx-log.c
+++ b/block/vhdx-log.c
@@ -965,8 +965,8 @@ static int vhdx_log_write(BlockDriverState *bs, BDRVVHDXState *s,
cpu_to_le32s((uint32_t *)(buffer + 4));
/* now write to the log */
- vhdx_log_write_sectors(bs, &s->log, §ors_written, buffer,
- desc_sectors + sectors);
+ ret = vhdx_log_write_sectors(bs, &s->log, §ors_written, buffer,
+ desc_sectors + sectors);
if (ret < 0) {
goto exit;
}
diff --git a/block/vhdx.c b/block/vhdx.c
index 9ee0a61..55689cf 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -374,7 +374,7 @@ static int vhdx_update_header(BlockDriverState *bs, BDRVVHDXState *s,
inactive_header->log_guid = *log_guid;
}
- vhdx_write_header(bs->file, inactive_header, header_offset, true);
+ ret = vhdx_write_header(bs->file, inactive_header, header_offset, true);
if (ret < 0) {
goto exit;
}
@@ -1810,13 +1810,13 @@ static int vhdx_create(const char *filename, QEMUOptionParameter *options,
creator = g_utf8_to_utf16("QEMU v" QEMU_VERSION, -1, NULL,
&creator_items, NULL);
signature = cpu_to_le64(VHDX_FILE_SIGNATURE);
- bdrv_pwrite(bs, VHDX_FILE_ID_OFFSET, &signature, sizeof(signature));
+ ret = bdrv_pwrite(bs, VHDX_FILE_ID_OFFSET, &signature, sizeof(signature));
if (ret < 0) {
goto delete_and_exit;
}
if (creator) {
- bdrv_pwrite(bs, VHDX_FILE_ID_OFFSET + sizeof(signature), creator,
- creator_items * sizeof(gunichar2));
+ ret = bdrv_pwrite(bs, VHDX_FILE_ID_OFFSET + sizeof(signature),
+ creator, creator_items * sizeof(gunichar2));
if (ret < 0) {
goto delete_and_exit;
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] block/vhdx: Error checking fixes
2014-01-29 17:05 [Qemu-devel] [PATCH] block/vhdx: Error checking fixes Markus Armbruster
@ 2014-01-29 17:14 ` Jeff Cody
2014-01-30 9:34 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Cody @ 2014-01-29 17:14 UTC (permalink / raw)
To: Markus Armbruster; +Cc: kwolf, qemu-devel, stefanha
On Wed, Jan 29, 2014 at 06:05:08PM +0100, Markus Armbruster wrote:
> Errors are inadvertently ignored in a few places. Has always been
> broken. Spotted by Coverity.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> block/vhdx-log.c | 4 ++--
> block/vhdx.c | 8 ++++----
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/block/vhdx-log.c b/block/vhdx-log.c
> index 8c9ae0d..02755b8 100644
> --- a/block/vhdx-log.c
> +++ b/block/vhdx-log.c
> @@ -965,8 +965,8 @@ static int vhdx_log_write(BlockDriverState *bs, BDRVVHDXState *s,
> cpu_to_le32s((uint32_t *)(buffer + 4));
>
> /* now write to the log */
> - vhdx_log_write_sectors(bs, &s->log, §ors_written, buffer,
> - desc_sectors + sectors);
> + ret = vhdx_log_write_sectors(bs, &s->log, §ors_written, buffer,
> + desc_sectors + sectors);
> if (ret < 0) {
> goto exit;
> }
> diff --git a/block/vhdx.c b/block/vhdx.c
> index 9ee0a61..55689cf 100644
> --- a/block/vhdx.c
> +++ b/block/vhdx.c
> @@ -374,7 +374,7 @@ static int vhdx_update_header(BlockDriverState *bs, BDRVVHDXState *s,
> inactive_header->log_guid = *log_guid;
> }
>
> - vhdx_write_header(bs->file, inactive_header, header_offset, true);
> + ret = vhdx_write_header(bs->file, inactive_header, header_offset, true);
> if (ret < 0) {
> goto exit;
> }
> @@ -1810,13 +1810,13 @@ static int vhdx_create(const char *filename, QEMUOptionParameter *options,
> creator = g_utf8_to_utf16("QEMU v" QEMU_VERSION, -1, NULL,
> &creator_items, NULL);
> signature = cpu_to_le64(VHDX_FILE_SIGNATURE);
> - bdrv_pwrite(bs, VHDX_FILE_ID_OFFSET, &signature, sizeof(signature));
> + ret = bdrv_pwrite(bs, VHDX_FILE_ID_OFFSET, &signature, sizeof(signature));
> if (ret < 0) {
> goto delete_and_exit;
> }
> if (creator) {
> - bdrv_pwrite(bs, VHDX_FILE_ID_OFFSET + sizeof(signature), creator,
> - creator_items * sizeof(gunichar2));
> + ret = bdrv_pwrite(bs, VHDX_FILE_ID_OFFSET + sizeof(signature),
> + creator, creator_items * sizeof(gunichar2));
> if (ret < 0) {
> goto delete_and_exit;
> }
> --
> 1.8.1.4
>
Reviewed-by: Jeff Cody <jcody@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] block/vhdx: Error checking fixes
2014-01-29 17:05 [Qemu-devel] [PATCH] block/vhdx: Error checking fixes Markus Armbruster
2014-01-29 17:14 ` Jeff Cody
@ 2014-01-30 9:34 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2014-01-30 9:34 UTC (permalink / raw)
To: Markus Armbruster; +Cc: kwolf, jcody, qemu-devel
On Wed, Jan 29, 2014 at 06:05:08PM +0100, Markus Armbruster wrote:
> Errors are inadvertently ignored in a few places. Has always been
> broken. Spotted by Coverity.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> block/vhdx-log.c | 4 ++--
> block/vhdx.c | 8 ++++----
> 2 files changed, 6 insertions(+), 6 deletions(-)
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-30 9:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-29 17:05 [Qemu-devel] [PATCH] block/vhdx: Error checking fixes Markus Armbruster
2014-01-29 17:14 ` Jeff Cody
2014-01-30 9:34 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).