* [Qemu-devel] [patch] Shut up compiler warning.
@ 2004-08-03 22:48 Paul Brook
0 siblings, 0 replies; only message in thread
From: Paul Brook @ 2004-08-03 22:48 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
The new bdrv_close callbacks are declared to return "int". However their
return value is never set, and always ignored. GCC rightly warns about this.
Attached patch changes them to have a void return type.
Is mailing patches to this list the preferred way of submitting changes? If
not what should I do with them?
Paul
[-- Attachment #2: patch.qemu_block_close --]
[-- Type: text/x-diff, Size: 2832 bytes --]
Index: block.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block.c,v
retrieving revision 1.12
diff -u -p -r1.12 block.c
--- block.c 3 Aug 2004 21:14:09 -0000 1.12
+++ block.c 3 Aug 2004 22:40:23 -0000
@@ -554,7 +554,7 @@ static int raw_write(BlockDriverState *b
return 0;
}
-static int raw_close(BlockDriverState *bs)
+static void raw_close(BlockDriverState *bs)
{
BDRVRawState *s = bs->opaque;
close(s->fd);
Index: block-cow.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block-cow.c,v
retrieving revision 1.2
diff -u -p -r1.2 block-cow.c
--- block-cow.c 3 Aug 2004 21:13:54 -0000 1.2
+++ block-cow.c 3 Aug 2004 22:40:23 -0000
@@ -202,7 +202,7 @@ static int cow_write(BlockDriverState *b
return 0;
}
-static int cow_close(BlockDriverState *bs)
+static void cow_close(BlockDriverState *bs)
{
BDRVCowState *s = bs->opaque;
munmap(s->cow_bitmap_addr, s->cow_bitmap_size);
Index: block_int.h
===================================================================
RCS file: /cvsroot/qemu/qemu/block_int.h,v
retrieving revision 1.1
diff -u -p -r1.1 block_int.h
--- block_int.h 1 Aug 2004 21:59:26 -0000 1.1
+++ block_int.h 3 Aug 2004 22:40:23 -0000
@@ -33,7 +33,7 @@ struct BlockDriver {
uint8_t *buf, int nb_sectors);
int (*bdrv_write)(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buf, int nb_sectors);
- int (*bdrv_close)(BlockDriverState *bs);
+ void (*bdrv_close)(BlockDriverState *bs);
int (*bdrv_create)(const char *filename, int64_t total_sectors,
const char *backing_file, int flags);
int (*bdrv_is_allocated)(BlockDriverState *bs, int64_t sector_num,
Index: block-qcow.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block-qcow.c,v
retrieving revision 1.2
diff -u -p -r1.2 block-qcow.c
--- block-qcow.c 3 Aug 2004 21:13:54 -0000 1.2
+++ block-qcow.c 3 Aug 2004 22:40:23 -0000
@@ -521,7 +521,7 @@ static int qcow_write(BlockDriverState *
return 0;
}
-static int qcow_close(BlockDriverState *bs)
+static void qcow_close(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
qemu_free(s->l1_table);
Index: block-vmdk.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block-vmdk.c,v
retrieving revision 1.2
diff -u -p -r1.2 block-vmdk.c
--- block-vmdk.c 3 Aug 2004 21:13:54 -0000 1.2
+++ block-vmdk.c 3 Aug 2004 22:40:23 -0000
@@ -257,7 +257,7 @@ static int vmdk_write(BlockDriverState *
return -1;
}
-static int vmdk_close(BlockDriverState *bs)
+static void vmdk_close(BlockDriverState *bs)
{
BDRVVmdkState *s = bs->opaque;
qemu_free(s->l1_table);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-08-03 22:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-03 22:48 [Qemu-devel] [patch] Shut up compiler warning Paul Brook
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).