Skip to content

Commit

Permalink
store qcow config files using the disk filename instead of bus name
Browse files Browse the repository at this point in the history
  • Loading branch information
abbbi committed Oct 9, 2024
1 parent ce7d034 commit bbda4a2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libqmpbackup/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_info(filename):
def save_info(backupdir, blockdev):
"""Save qcow image information"""
for dev in blockdev:
infofile = os.path.join(backupdir, f"{dev.node}.config")
infofile = os.path.join(backupdir, f"{os.path.basename(dev.filename)}.config")

info = get_info(dev.filename)
try:
Expand All @@ -53,7 +53,9 @@ def _get_options_cmd(backupdir, dev):
"""Read options to apply for backup target image from
qcow image info json output"""
opt = []
with open(os.path.join(backupdir, f"{dev.node}.config"), "rb") as config_file:
with open(
os.path.join(backupdir, f"{os.path.basename(dev.filename)}.config"), "rb"
) as config_file:
qcow_config = json.loads(config_file.read().decode())

try:
Expand Down

0 comments on commit bbda4a2

Please sign in to comment.