Bug 1431652 - libvirt cannot handle json backing file with relative paths
Summary: libvirt cannot handle json backing file with relative paths
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: TRACKER-bugs-affecting-libguestfs
TreeView+ depends on / blocked
 
Reported: 2017-03-13 14:20 UTC by Richard W.M. Jones
Modified: 2024-12-17 12:19 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-12-17 12:19:47 UTC
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2017-03-13 14:20:55 UTC
Description of problem:

When using disk images with backing files specified using json: URLs,
libvirt cannot handle backing files using relative paths.

Version-Release number of selected component (if applicable):

libvirt-devel-3.1.0-1.fc27.x86_64

How reproducible:

100%

Steps to Reproduce:

1. Create a disk image with the required properties:

cd /var/tmp
rm -f test-*
truncate -s 100M test-backing.img
qemu-img create test-overlay.img -f qcow2 \
    -b 'json:{"driver":"raw",
               "file":{"driver":"file","filename":"test-backing.img"}}'

Notice that /var/tmp/test-overlay.img contains a relative link
to test-backing.img which is in the same directory as the overlay.

qemu has no problem with relative links:

$ qemu-img info test-overlay.img 
image: test-overlay.img
file format: qcow2
virtual size: 100M (104857600 bytes)
disk size: 196K
cluster_size: 65536
backing file: json:{"driver":"raw","file":{"driver":"file","filename":"test-backing.img"}}
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

2. Of course this isn't a real VM, but let's try to boot it anyway.

cd /var/tmp
virt-install --import --name tmp-relpaths --memory 1024 --disk /var/tmp/test-overlay.img

The error is:

  WARNING  No operating system detected, VM performance may suffer. Specify an OS with --os-variant for optimal results.

  Starting install...
  ERROR    Cannot access backing file 'test-backing.img' of storage file '/var/tmp/test-overlay.img' (as uid:4294967295, gid:4294967295): No such file or directory
  Domain installation does not appear to have been successful.
  If it was, you can restart your domain by running:
    virsh --connect qemu:///session start tmp-relpaths
  otherwise, please restart your installation.

Note that to clean up you may need to do:

virsh list --all
virsh undefine tmp-relpaths

Comment 1 Daniel Berrangé 2024-12-17 12:19:47 UTC
Thank you for reporting this issue to the libvirt project. Unfortunately we have been unable to resolve this issue due to insufficient maintainer capacity and it will now be closed. This is not a reflection on the possible validity of the issue, merely the lack of resources to investigate and address it, for which we apologise. If you none the less feel the issue is still important, you may choose to report it again at the new project issue tracker https://gitlab.com/libvirt/libvirt/-/issues The project also welcomes contribution from anyone who believes they can provide a solution.


Note You need to log in before you can comment on or make changes to this bug.