vmdk.c (067179868ec8cd467d9810143339e882cb60e388) vmdk.c (004915a96a7a40e942ac85e6d22518cbcd283506)
1/*
2 * Block driver for the VMDK format
3 *
4 * Copyright (c) 2004 Fabrice Bellard
5 * Copyright (c) 2005 Filip Navara
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

--- 366 unchanged lines hidden (view full) ---

375 ret = bdrv_co_pwrite_sync(bs->file, s->desc_offset, DESC_SIZE, desc, 0);
376
377out:
378 g_free(desc);
379 g_free(tmp_desc);
380 return ret;
381}
382
1/*
2 * Block driver for the VMDK format
3 *
4 * Copyright (c) 2004 Fabrice Bellard
5 * Copyright (c) 2005 Filip Navara
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

--- 366 unchanged lines hidden (view full) ---

375 ret = bdrv_co_pwrite_sync(bs->file, s->desc_offset, DESC_SIZE, desc, 0);
376
377out:
378 g_free(desc);
379 g_free(tmp_desc);
380 return ret;
381}
382
383static int coroutine_fn vmdk_is_cid_valid(BlockDriverState *bs)
383static int coroutine_fn GRAPH_RDLOCK vmdk_is_cid_valid(BlockDriverState *bs)
384{
385 BDRVVmdkState *s = bs->opaque;
386 uint32_t cur_pcid;
387
388 if (!s->cid_checked && bs->backing) {
389 BlockDriverState *p_bs = bs->backing->bs;
390
391 if (strcmp(p_bs->drv->format_name, "vmdk")) {

--- 2647 unchanged lines hidden (view full) ---

3039 }
3040 bdi->needs_compressed_writes = s->extents[0].compressed;
3041 if (!s->extents[0].flat) {
3042 bdi->cluster_size = s->extents[0].cluster_sectors << BDRV_SECTOR_BITS;
3043 }
3044 return 0;
3045}
3046
384{
385 BDRVVmdkState *s = bs->opaque;
386 uint32_t cur_pcid;
387
388 if (!s->cid_checked && bs->backing) {
389 BlockDriverState *p_bs = bs->backing->bs;
390
391 if (strcmp(p_bs->drv->format_name, "vmdk")) {

--- 2647 unchanged lines hidden (view full) ---

3039 }
3040 bdi->needs_compressed_writes = s->extents[0].compressed;
3041 if (!s->extents[0].flat) {
3042 bdi->cluster_size = s->extents[0].cluster_sectors << BDRV_SECTOR_BITS;
3043 }
3044 return 0;
3045}
3046
3047static void vmdk_gather_child_options(BlockDriverState *bs, QDict *target,
3048 bool backing_overridden)
3047static void GRAPH_RDLOCK
3048vmdk_gather_child_options(BlockDriverState *bs, QDict *target,
3049 bool backing_overridden)
3049{
3050 /* No children but file and backing can be explicitly specified (TODO) */
3051 qdict_put(target, "file",
3052 qobject_ref(bs->file->bs->full_open_options));
3053
3054 if (backing_overridden) {
3055 if (bs->backing) {
3056 qdict_put(target, "backing",

--- 102 unchanged lines hidden ---
3050{
3051 /* No children but file and backing can be explicitly specified (TODO) */
3052 qdict_put(target, "file",
3053 qobject_ref(bs->file->bs->full_open_options));
3054
3055 if (backing_overridden) {
3056 if (bs->backing) {
3057 qdict_put(target, "backing",

--- 102 unchanged lines hidden ---