Commit 82913df
committed
Fix qcow2 support for absolute backing_file paths
_open_backing_file assumed that the backing_file path
was always a filename relative to the snapshot path.
Using .with_name() to concat the whole path broke the use
case for absolute path for the backing_file causing
ValueError("Invalid name ...").
This change updates the logic to detect whether auto_backing_file is an
absolute path. If so, it is used directly; otherwise we fall back to
constructing the path relative to the snapshot location.
This will support the following use-cases:
backing file: /home/user/workdir/ubuntu-22.04.qcow2
backing file: ubuntu-22.04.qcow2
backing file: ./ubuntu-22.04-packer.qcow2
backing file: ../../ubuntu-22.04-packer.qcow2
Fixes: #64
Signed-off-by: Andreia Ocanoaia <[email protected]>1 parent 2e2d0aa commit 82913df
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
192 | 198 | | |
193 | 199 | | |
194 | 200 | | |
| |||
0 commit comments