aboutsummaryrefslogtreecommitdiff
path: root/block/vhdx.h
diff options
context:
space:
mode:
authorJeff Cody <jcody@redhat.com>2013-10-30 10:44:47 -0400
committerStefan Hajnoczi <stefanha@redhat.com>2013-11-07 13:58:59 +0100
commit8adc52336d9c44ab4c7b9358a7be22ac0ef962bf (patch)
tree65cfb1879270b64b35e88d8e5ba155646b5feb26 /block/vhdx.h
parent1a848fd4517820981b542e0d10e64c0426414229 (diff)
block: vhdx - add log write support
This adds support for writing to the VHDX log. For spec details, see VHDX Specification Format v1.00: https://www.microsoft.com/en-us/download/details.aspx?id=34750 There are a few limitations to this log support: 1.) There is no caching yet 2.) The log is flushed after each entry The primary write interface, vhdx_log_write_and_flush(), performs a log write followed by an immediate flush of the log. As each log entry sector is a minimum of 4KB, partial sector writes are filled in with data from the disk write destination. If the current file log GUID is 0, a new GUID is generated and updated in the header. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/vhdx.h')
-rw-r--r--block/vhdx.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/vhdx.h b/block/vhdx.h
index d9065595fc..6abbf5090b 100644
--- a/block/vhdx.h
+++ b/block/vhdx.h
@@ -398,6 +398,9 @@ bool vhdx_checksum_is_valid(uint8_t *buf, size_t size, int crc_offset);
int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s, bool *flushed);
+int vhdx_log_write_and_flush(BlockDriverState *bs, BDRVVHDXState *s,
+ void *data, uint32_t length, uint64_t offset);
+
static inline void leguid_to_cpus(MSGUID *guid)
{
le32_to_cpus(&guid->data1);