[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/17] sheepdog: explicitly set copies as type uint8_
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 12/17] sheepdog: explicitly set copies as type uint8_t |
Date: |
Tue, 29 Oct 2013 17:31:04 +0100 |
From: Liu Yuan <address@hidden>
'copies' is actually uint8_t since day one, but request headers and some helper
functions parameterize it as uint32_t for unknown reasons and effectively
reserve 24 bytes for possible future use. This patch explicitly set the correct
for copies and reserve the left bytes.
This is a preparation patch that allow passing copy_policy in request header.
Cc: Kevin Wolf <address@hidden>
Cc: Stefan Hajnoczi <address@hidden>
Signed-off-by: Liu Yuan <address@hidden>
Acked-by: MORITA Kazutaka <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/sheepdog.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 5f81c93..b8a2985 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -125,8 +125,8 @@ typedef struct SheepdogObjReq {
uint32_t data_length;
uint64_t oid;
uint64_t cow_oid;
- uint32_t copies;
- uint32_t rsvd;
+ uint8_t copies;
+ uint8_t reserved[7];
uint64_t offset;
} SheepdogObjReq;
@@ -138,7 +138,8 @@ typedef struct SheepdogObjRsp {
uint32_t id;
uint32_t data_length;
uint32_t result;
- uint32_t copies;
+ uint8_t copies;
+ uint8_t reserved[3];
uint32_t pad[6];
} SheepdogObjRsp;
@@ -151,7 +152,8 @@ typedef struct SheepdogVdiReq {
uint32_t data_length;
uint64_t vdi_size;
uint32_t vdi_id;
- uint32_t copies;
+ uint8_t copies;
+ uint8_t reserved[3];
uint32_t snapid;
uint32_t pad[3];
} SheepdogVdiReq;
@@ -1081,7 +1083,7 @@ static int coroutine_fn add_aio_request(BDRVSheepdogState
*s, AIOReq *aio_req,
return 0;
}
-static int read_write_object(int fd, char *buf, uint64_t oid, int copies,
+static int read_write_object(int fd, char *buf, uint64_t oid, uint8_t copies,
unsigned int datalen, uint64_t offset,
bool write, bool create, uint32_t cache_flags)
{
@@ -1129,7 +1131,7 @@ static int read_write_object(int fd, char *buf, uint64_t
oid, int copies,
}
}
-static int read_object(int fd, char *buf, uint64_t oid, int copies,
+static int read_object(int fd, char *buf, uint64_t oid, uint8_t copies,
unsigned int datalen, uint64_t offset,
uint32_t cache_flags)
{
@@ -1137,7 +1139,7 @@ static int read_object(int fd, char *buf, uint64_t oid,
int copies,
false, cache_flags);
}
-static int write_object(int fd, char *buf, uint64_t oid, int copies,
+static int write_object(int fd, char *buf, uint64_t oid, uint8_t copies,
unsigned int datalen, uint64_t offset, bool create,
uint32_t cache_flags)
{
--
1.8.1.4
- [Qemu-devel] [PULL 04/17] qemu-img: add special exit code if bdrv_check is not supported, (continued)
- [Qemu-devel] [PULL 04/17] qemu-img: add special exit code if bdrv_check is not supported, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 02/17] qcow2: Restore total_sectors value in save_vmstate, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 05/17] block/vpc: check that the image has not been truncated, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 03/17] qcow2: Unset zero_beyond_eof in save_vmstate, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 06/17] qemu-iotests: Test for loading VM state from qcow2, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 07/17] qcow2: Flush image after creation, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 08/17] exec: Fix bounce buffer allocation in address_space_map(), Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 09/17] ide-test: Check what happens with bus mastering disabled, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 10/17] tests: Multiboot mmap test case, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 11/17] block: Don't copy backing file name on error, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 12/17] sheepdog: explicitly set copies as type uint8_t,
Kevin Wolf <=
- [Qemu-devel] [PULL 13/17] sheepdog: pass copy_policy in the request, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 14/17] ahci: fix win7 hang on boot, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 15/17] block: Disable BDRV_O_COPY_ON_READ for the backing file, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 16/17] block: Avoid unecessary drv->bdrv_getlength() calls, Kevin Wolf, 2013/10/29
- [Qemu-devel] [PULL 17/17] qemu-iotests: Fix 051 reference output, Kevin Wolf, 2013/10/29