Skip to content

LVHDSR: convert VDI.ref retured by get_snapshot_of to vdi_uuid#781

Merged
MarkSymsCtx merged 4 commits intoxapi-project:masterfrom
xcp-ng:abo-convert-vdi-ref-to-vdi-uuid-in-get-snapshot-of
Jan 22, 2026
Merged

LVHDSR: convert VDI.ref retured by get_snapshot_of to vdi_uuid#781
MarkSymsCtx merged 4 commits intoxapi-project:masterfrom
xcp-ng:abo-convert-vdi-ref-to-vdi-uuid-in-get-snapshot-of

Conversation

@AnthoineB
Copy link
Contributor

@AnthoineB AnthoineB commented Nov 13, 2025

'scan' function uses SNAPSHOT_OF_TAG as a vdi_uuid. Same, function '_finishSnapshot', part of 'clone', initialize SNAPSHOT_OF_TAG field with a vdi_uuid.
Without this patch the MGT is filled with 'OpaqueRef:' VDI after MGT is recreated.

To reproduce:

  1. Create a VDI with a snapshot on LVM SR <SR UUID>.
  2. lvremove /dev/VG_XenStorage-<SR UUID>/MGT
  3. xe sr-scan uuid=<SR UUID>

@MarkSymsCtx
Copy link
Contributor

It might be good to add something to https://github.com/xapi-project/sm/blob/master/tests/test_LVHDSR.py#L111 that checks the correct values are written to the metadata.

@AnthoineB AnthoineB force-pushed the abo-convert-vdi-ref-to-vdi-uuid-in-get-snapshot-of branch 2 times, most recently from 8c604af to bff23f3 Compare December 16, 2025 16:31
@AnthoineB
Copy link
Contributor Author

It might be good to add something to https://github.com/xapi-project/sm/blob/master/tests/test_LVHDSR.py#L111 that checks the correct values are written to the metadata.

I create a new test because it was changing the original test too much. I also add 2 small patch I find when writing the test.

Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@vates.tech>
Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@vates.tech>
Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@vates.tech>
…ormat

Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@vates.tech>
@AnthoineB AnthoineB force-pushed the abo-convert-vdi-ref-to-vdi-uuid-in-get-snapshot-of branch from bff23f3 to 661eed0 Compare December 16, 2025 17:15
@MarkSymsCtx MarkSymsCtx merged commit 2ac4e67 into xapi-project:master Jan 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants