[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 07/16] qcow2: Write v3-compliant snapshot list on upgrade
From: |
Max Reitz |
Subject: |
Re: [PATCH v3 07/16] qcow2: Write v3-compliant snapshot list on upgrade |
Date: |
Mon, 14 Oct 2019 10:45:39 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 |
On 11.10.19 18:23, Eric Blake wrote:
> On 10/11/19 10:28 AM, Max Reitz wrote:
>> qcow2 v3 requires every snapshot table entry to have two extra data
>> fields: The 64-bit VM state size, and the virtual disk size. Both are
>> optional for v2 images, so they may not be present.
>>
>> qcow2_upgrade() therefore should update the snapshot table to ensure all
>> entries have these extra data fields.
>>
>> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1727347
>> Reported-by: Eric Blake <address@hidden>
>> Signed-off-by: Max Reitz <address@hidden>
>> Reviewed-by: Eric Blake <address@hidden>
>> ---
>> block/qcow2.c | 32 ++++++++++++++++++++++++++++++--
>> 1 file changed, 30 insertions(+), 2 deletions(-)
>>
>
>> + need_snapshot_update = false;
>> + for (i = 0; i < s->nb_snapshots; i++) {
>> + if (s->snapshots[i].extra_data_size <
>> + sizeof_field(QCowSnapshotExtraData, vm_state_size_large) +
>> + sizeof_field(QCowSnapshotExtraData, disk_size))
>
> Shorter as:
> if (s->snapshots[i].extra_data_size < sizeof(QCowSnapshotExtraData))
>
> but that's stylistic, so R-b still stands.
Yes, but if we ever add fields to QCowSnapshotExtraData, we shouldn’t
count them here. Therefore, I think we need to count exactly the fields
that the standard says are mandatory in v3.
Max
signature.asc
Description: OpenPGP digital signature
- [PATCH v3 01/16] include: Move endof() up from hw/virtio/virtio.h, (continued)
- [PATCH v3 01/16] include: Move endof() up from hw/virtio/virtio.h, Max Reitz, 2019/10/11
- [PATCH v3 02/16] qcow2: Use endof(), Max Reitz, 2019/10/11
- [PATCH v3 03/16] qcow2: Add Error ** to qcow2_read_snapshots(), Max Reitz, 2019/10/11
- [PATCH v3 04/16] qcow2: Keep unknown extra snapshot data, Max Reitz, 2019/10/11
- [PATCH v3 05/16] qcow2: Make qcow2_write_snapshots() public, Max Reitz, 2019/10/11
- [PATCH v3 06/16] qcow2: Put qcow2_upgrade() into its own function, Max Reitz, 2019/10/11
- [PATCH v3 07/16] qcow2: Write v3-compliant snapshot list on upgrade, Max Reitz, 2019/10/11
[PATCH v3 08/16] qcow2: Separate qcow2_check_read_snapshot_table(), Max Reitz, 2019/10/11
[PATCH v3 09/16] qcow2: Add qcow2_check_fix_snapshot_table(), Max Reitz, 2019/10/11
[PATCH v3 10/16] qcow2: Fix broken snapshot table entries, Max Reitz, 2019/10/11
[PATCH v3 11/16] qcow2: Keep track of the snapshot table length, Max Reitz, 2019/10/11
[PATCH v3 12/16] qcow2: Fix overly long snapshot tables, Max Reitz, 2019/10/11
[PATCH v3 13/16] qcow2: Repair snapshot table with too many entries, Max Reitz, 2019/10/11
[PATCH v3 14/16] qcow2: Fix v3 snapshot table entry compliancy, Max Reitz, 2019/10/11