]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_shim: Require absolute path for root directory
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 22 Mar 2023 11:39:21 +0000 (12:39 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 22 Mar 2023 14:53:33 +0000 (15:53 +0100)
commitb407897ea9502d0d03cc54ce34afbf2e0ec98ff8
tree904e39c9c3dcfd2ec482dd326c19b8a9ab528a0a
parent94862a77be49c2e11f75700bfb38f7a6c1001c26
qemu_shim: Require absolute path for root directory

The virConnectOpen(), well virConnectOpenInternal() reports an
error if embed root is not an absolute path. This is a fair
requirement, but our qemu_shim doesn't check this requirement and
passes the path to mkdir(), only to fail later on, leaving the
empty directory behind:

  $ ls -d asd
  ls: cannot access 'asd': No such file or directory

  $ virt-qemu-run -r asd whatever.xml
  virt-qemu-run: cannot open qemu:///embed?root=asd: unsupported configuration: root path must be absolute

  $ ls -d asd
  asd

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
src/qemu/qemu_shim.c