Skip to content

fix config adjustment when using data_file with block device#317

Open
bensonbbarry wants to merge 2 commits into
abbbi:masterfrom
bensonbbarry:fix/data-file-block-devices
Open

fix config adjustment when using data_file with block device#317
bensonbbarry wants to merge 2 commits into
abbbi:masterfrom
bensonbbarry:fix/data-file-block-devices

Conversation

@bensonbbarry

Copy link
Copy Markdown

Summary

Fix two bugs in config adjustment and libvirt XML datastore backend handling.

Changes

Issue 1: dataFilePath undefined when adjust_config is False

  • dataFilePath was only assigned inside the if adjust_config block, causing
    an UnboundLocalError when the variable was referenced later with adjust_config=False
  • Fixed by initialising dataFilePath = dataFile before the conditional block

Issue 2: Block device backend fails during libvirt XML datastore adjustment

  • Code assumed the datastore backend was always a file device
  • Added handling for block devices so both file and block backends are
    supported correctly

Testing

  • Tested with adjust_config=False — no longer raises UnboundLocalError
  • Tested with block device backend — XML adjustment completes successfully

@abbbi

abbbi commented Jun 29, 2026

Copy link
Copy Markdown
Owner

hi,

thanks, but fails in code format test:

https://github.com/abbbi/virtnbdbackup/actions/runs/28385204851/job/84105978699?pr=317

code should be formatted using black 25.1.0

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.

2 participants