mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35:20 +00:00
qcow: bugfix: do not write v3 items to qcow header
Fixes: 3f02ccaa8
Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
This commit is contained in:
parent
741d640330
commit
ffe78c98fd
@ -324,11 +324,14 @@ impl QcowHeader {
|
||||
write_u32_to_file(file, self.refcount_table_clusters)?;
|
||||
write_u32_to_file(file, self.nb_snapshots)?;
|
||||
write_u64_to_file(file, self.snapshots_offset)?;
|
||||
write_u64_to_file(file, self.incompatible_features)?;
|
||||
write_u64_to_file(file, self.compatible_features)?;
|
||||
write_u64_to_file(file, self.autoclear_features)?;
|
||||
write_u32_to_file(file, self.refcount_order)?;
|
||||
write_u32_to_file(file, self.header_size)?;
|
||||
|
||||
if self.version == 3 {
|
||||
write_u64_to_file(file, self.incompatible_features)?;
|
||||
write_u64_to_file(file, self.compatible_features)?;
|
||||
write_u64_to_file(file, self.autoclear_features)?;
|
||||
write_u32_to_file(file, self.refcount_order)?;
|
||||
write_u32_to_file(file, self.header_size)?;
|
||||
}
|
||||
|
||||
// Set the file length by seeking and writing a zero to the last byte. This avoids needing
|
||||
// a `File` instead of anything that implements seek as the `file` argument.
|
||||
|
Loading…
Reference in New Issue
Block a user