diff options
author | Fathi Boudra <fathi.boudra@linaro.org> | 2012-12-15 09:08:08 +0200 |
---|---|---|
committer | Fathi Boudra <fathi.boudra@linaro.org> | 2012-12-25 16:58:57 +0200 |
commit | edde41b3c75bce779549bd2e1dba18eb7beb8267 (patch) | |
tree | 62ac7686da47a3ea220ec820679305f47dd1012b /block/qcow2.c | |
parent | f77d2c3c841d1990d10ab147b770bf5673dbfacc (diff) | |
parent | 17d4e9b1e2d6d32da51278a4165621af99bade02 (diff) |
Imported Debian patch 1.3.0-2012.12-0ubuntu1~linaro1debian/1.3.0-2012.12-0ubuntu1_linaro1
Diffstat (limited to 'block/qcow2.c')
-rw-r--r-- | block/qcow2.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index 8f183f1..c1ff31f 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -52,6 +52,7 @@ typedef struct { uint32_t magic; uint32_t len; } QCowExtension; + #define QCOW2_EXT_MAGIC_END 0 #define QCOW2_EXT_MAGIC_BACKING_FORMAT 0xE2792ACA #define QCOW2_EXT_MAGIC_FEATURE_TABLE 0x6803f857 @@ -558,6 +559,14 @@ static int qcow2_set_key(BlockDriverState *bs, const char *key) return 0; } +/* We have nothing to do for QCOW2 reopen, stubs just return + * success */ +static int qcow2_reopen_prepare(BDRVReopenState *state, + BlockReopenQueue *queue, Error **errp) +{ + return 0; +} + static int coroutine_fn qcow2_co_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *pnum) { @@ -1087,6 +1096,7 @@ int qcow2_update_header(BlockDriverState *bs) goto fail; } + /* Using strncpy is ok here, since buf is not NUL-terminated. */ strncpy(buf, bs->backing_file, buflen); header->backing_file_offset = cpu_to_be64(buf - ((char*) header)); @@ -1679,6 +1689,7 @@ static BlockDriver bdrv_qcow2 = { .bdrv_probe = qcow2_probe, .bdrv_open = qcow2_open, .bdrv_close = qcow2_close, + .bdrv_reopen_prepare = qcow2_reopen_prepare, .bdrv_create = qcow2_create, .bdrv_co_is_allocated = qcow2_co_is_allocated, .bdrv_set_key = qcow2_set_key, |