|
|
9ae3a8 |
From 2abbf288d8f8cd28b89358c50bb881b2afd974c2 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Jeffrey Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
Date: Wed, 20 Nov 2013 19:43:52 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 09/25] block: vhdx code movement - VHDXMetadataEntries and BDRVVHDXState to header.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Jeffrey Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
Message-id: <9c245806ba56c5fa2386de02cffbaace28aa928c.1384975172.git.jcody@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 55802
|
|
|
9ae3a8 |
O-Subject: [RHEL7 qemu-kvm PATCH 09/26] block: vhdx code movement - VHDXMetadataEntries and BDRVVHDXState to header.
|
|
|
9ae3a8 |
Bugzilla: 879234
|
|
|
9ae3a8 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
In preparation for VHDX log support, move these structures to the
|
|
|
9ae3a8 |
header.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Jeff Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 28541d46280733b9afe7b106a3a6665275a45e5f)
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/vhdx.c | 52 ----------------------------------------------------
|
|
|
9ae3a8 |
block/vhdx.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
9ae3a8 |
2 files changed, 48 insertions(+), 52 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/vhdx.c | 52 ----------------------------------------------------
|
|
|
9ae3a8 |
block/vhdx.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
9ae3a8 |
2 files changed, 48 insertions(+), 52 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/block/vhdx.c b/block/vhdx.c
|
|
|
9ae3a8 |
index fba2aa9..16321ff 100644
|
|
|
9ae3a8 |
--- a/block/vhdx.c
|
|
|
9ae3a8 |
+++ b/block/vhdx.c
|
|
|
9ae3a8 |
@@ -105,16 +105,6 @@ static const MSGUID parent_vhdx_guid = { .data1 = 0xb04aefb7,
|
|
|
9ae3a8 |
META_PAGE_83_PRESENT | META_LOGICAL_SECTOR_SIZE_PRESENT | \
|
|
|
9ae3a8 |
META_PHYS_SECTOR_SIZE_PRESENT)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-typedef struct VHDXMetadataEntries {
|
|
|
9ae3a8 |
- VHDXMetadataTableEntry file_parameters_entry;
|
|
|
9ae3a8 |
- VHDXMetadataTableEntry virtual_disk_size_entry;
|
|
|
9ae3a8 |
- VHDXMetadataTableEntry page83_data_entry;
|
|
|
9ae3a8 |
- VHDXMetadataTableEntry logical_sector_size_entry;
|
|
|
9ae3a8 |
- VHDXMetadataTableEntry phys_sector_size_entry;
|
|
|
9ae3a8 |
- VHDXMetadataTableEntry parent_locator_entry;
|
|
|
9ae3a8 |
- uint16_t present;
|
|
|
9ae3a8 |
-} VHDXMetadataEntries;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
typedef struct VHDXSectorInfo {
|
|
|
9ae3a8 |
uint32_t bat_idx; /* BAT entry index */
|
|
|
9ae3a8 |
@@ -125,48 +115,6 @@ typedef struct VHDXSectorInfo {
|
|
|
9ae3a8 |
uint64_t block_offset; /* block offset, in bytes */
|
|
|
9ae3a8 |
} VHDXSectorInfo;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
-typedef struct BDRVVHDXState {
|
|
|
9ae3a8 |
- CoMutex lock;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- int curr_header;
|
|
|
9ae3a8 |
- VHDXHeader *headers[2];
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- VHDXRegionTableHeader rt;
|
|
|
9ae3a8 |
- VHDXRegionTableEntry bat_rt; /* region table for the BAT */
|
|
|
9ae3a8 |
- VHDXRegionTableEntry metadata_rt; /* region table for the metadata */
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- VHDXMetadataTableHeader metadata_hdr;
|
|
|
9ae3a8 |
- VHDXMetadataEntries metadata_entries;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- VHDXFileParameters params;
|
|
|
9ae3a8 |
- uint32_t block_size;
|
|
|
9ae3a8 |
- uint32_t block_size_bits;
|
|
|
9ae3a8 |
- uint32_t sectors_per_block;
|
|
|
9ae3a8 |
- uint32_t sectors_per_block_bits;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- uint64_t virtual_disk_size;
|
|
|
9ae3a8 |
- uint32_t logical_sector_size;
|
|
|
9ae3a8 |
- uint32_t physical_sector_size;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- uint64_t chunk_ratio;
|
|
|
9ae3a8 |
- uint32_t chunk_ratio_bits;
|
|
|
9ae3a8 |
- uint32_t logical_sector_size_bits;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- uint32_t bat_entries;
|
|
|
9ae3a8 |
- VHDXBatEntry *bat;
|
|
|
9ae3a8 |
- uint64_t bat_offset;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- MSGUID session_guid;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- VHDXParentLocatorHeader parent_header;
|
|
|
9ae3a8 |
- VHDXParentLocatorEntry *parent_entries;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
- Error *migration_blocker;
|
|
|
9ae3a8 |
-} BDRVVHDXState;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
/* Calculates new checksum.
|
|
|
9ae3a8 |
*
|
|
|
9ae3a8 |
* Zero is substituted during crc calculation for the original crc field
|
|
|
9ae3a8 |
diff --git a/block/vhdx.h b/block/vhdx.h
|
|
|
9ae3a8 |
index 2223b15..57375ff 100644
|
|
|
9ae3a8 |
--- a/block/vhdx.h
|
|
|
9ae3a8 |
+++ b/block/vhdx.h
|
|
|
9ae3a8 |
@@ -308,6 +308,54 @@ typedef struct QEMU_PACKED VHDXParentLocatorEntry {
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
/* ----- END VHDX SPECIFICATION STRUCTURES ---- */
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+typedef struct VHDXMetadataEntries {
|
|
|
9ae3a8 |
+ VHDXMetadataTableEntry file_parameters_entry;
|
|
|
9ae3a8 |
+ VHDXMetadataTableEntry virtual_disk_size_entry;
|
|
|
9ae3a8 |
+ VHDXMetadataTableEntry page83_data_entry;
|
|
|
9ae3a8 |
+ VHDXMetadataTableEntry logical_sector_size_entry;
|
|
|
9ae3a8 |
+ VHDXMetadataTableEntry phys_sector_size_entry;
|
|
|
9ae3a8 |
+ VHDXMetadataTableEntry parent_locator_entry;
|
|
|
9ae3a8 |
+ uint16_t present;
|
|
|
9ae3a8 |
+} VHDXMetadataEntries;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+typedef struct BDRVVHDXState {
|
|
|
9ae3a8 |
+ CoMutex lock;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ int curr_header;
|
|
|
9ae3a8 |
+ VHDXHeader *headers[2];
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ VHDXRegionTableHeader rt;
|
|
|
9ae3a8 |
+ VHDXRegionTableEntry bat_rt; /* region table for the BAT */
|
|
|
9ae3a8 |
+ VHDXRegionTableEntry metadata_rt; /* region table for the metadata */
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ VHDXMetadataTableHeader metadata_hdr;
|
|
|
9ae3a8 |
+ VHDXMetadataEntries metadata_entries;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ VHDXFileParameters params;
|
|
|
9ae3a8 |
+ uint32_t block_size;
|
|
|
9ae3a8 |
+ uint32_t block_size_bits;
|
|
|
9ae3a8 |
+ uint32_t sectors_per_block;
|
|
|
9ae3a8 |
+ uint32_t sectors_per_block_bits;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ uint64_t virtual_disk_size;
|
|
|
9ae3a8 |
+ uint32_t logical_sector_size;
|
|
|
9ae3a8 |
+ uint32_t physical_sector_size;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ uint64_t chunk_ratio;
|
|
|
9ae3a8 |
+ uint32_t chunk_ratio_bits;
|
|
|
9ae3a8 |
+ uint32_t logical_sector_size_bits;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ uint32_t bat_entries;
|
|
|
9ae3a8 |
+ VHDXBatEntry *bat;
|
|
|
9ae3a8 |
+ uint64_t bat_offset;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ MSGUID session_guid;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ VHDXParentLocatorHeader parent_header;
|
|
|
9ae3a8 |
+ VHDXParentLocatorEntry *parent_entries;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ Error *migration_blocker;
|
|
|
9ae3a8 |
+} BDRVVHDXState;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
void vhdx_guid_generate(MSGUID *guid);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|