Bug 1883725 - virt-qemu-run' failed to start qemu process with relative root dir
Summary: virt-qemu-run' failed to start qemu process with relative root dir
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.3
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: 8.3
Assignee: Michal Privoznik
QA Contact: yafu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-30 03:07 UTC by yafu
Modified: 2021-11-16 08:00 UTC (History)
8 users (show)

Fixed In Version: libvirt-7.3.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 07:51:01 UTC
Type: Bug
Target Upstream Version: 7.2.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:4684 0 None None None 2021-11-16 07:51:22 UTC

Description yafu 2020-09-30 03:07:41 UTC
Description of problem:
'virt-qemu-run' failed to start qemu process with relative root dir. If 'virt-qemu-run' does not support relative root dir, it's better to report a clear error and not try to create directory tree in the relative dir.

Version-Release number of selected component (if applicable):
libvirt-6.6.0-6.module+el8.3.0+8125+aefcf088.x86_64
qemu-kvm-5.1.0-10.module+el8.3.0+8254+568ca30d.x86_64

How reproducible:
100%

Steps to Reproduce:
1.#cd /var/tmp/

2.#mkdir vm1

3.#setenforce 0; virt-qemu-run -d -v  /root/xml/vm1.xml  -r vm1
virt-qemu-run: 83: initializing libvirt
virt-qemu-run: 1670: initializing signal handlers
virt-qemu-run: 1684: preparing event loop thread
virt-qemu-run: 1759: opening qemu:///embed?root=vm1
virt-qemu-run: 59197: starting guest /root/xml/vm1.xml
virt-qemu-run: cannot start VM: can't connect to virtlogd: Unable to open file: vm1/log/qemu/83.log: No such file or directory
virt-qemu-run: 1405241: cleaned up, exiting

4.# tree -f vm1
vm1
├── vm1/cache
│   └── vm1/cache/qemu
│       └── vm1/cache/qemu/capabilities
│           └── vm1/cache/qemu/capabilities/3c76bc41d59c0c7314b1ae8e63f4f765d2cf16abaeea081b3ca1f5d8732f7bb1.xml
├── vm1/lib
│   └── vm1/lib/qemu
│       ├── vm1/lib/qemu/channel
│       │   └── vm1/lib/qemu/channel/target
│       ├── vm1/lib/qemu/checkpoint
│       ├── vm1/lib/qemu/dump
│       ├── vm1/lib/qemu/nvram
│       ├── vm1/lib/qemu/ram
│       ├── vm1/lib/qemu/save
│       └── vm1/lib/qemu/snapshot
├── vm1/log
│   └── vm1/log/qemu
└── vm1/run
    └── vm1/run/qemu
        ├── vm1/run/qemu/autostarted
        ├── vm1/run/qemu/dbus
        ├── vm1/run/qemu/driver.pid
        └── vm1/run/qemu/slirp

19 directories, 3 files


5.#rm -rf vm1

6.# virt-qemu-run -d -v  /root/xml/vm1.xml  -r vm1
virt-qemu-run: 57: initializing libvirt
virt-qemu-run: 1877: initializing signal handlers
virt-qemu-run: 1891: preparing event loop thread
virt-qemu-run: 1976: opening qemu:///embed?root=vm1
2020-09-30 01:49:31.875+0000: 244223: info : libvirt version: 6.6.0, package: 6.virtcov.el8 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2020-09-17-01:41:02, )
2020-09-30 01:49:31.875+0000: 244223: info : hostname: dell-per730-36.lab.eng.pek2.redhat.com
2020-09-30 01:49:31.875+0000: 244223: error : virStateInitialize:662 : Initialisation of QEMU state driver failed: Failed to create state dir vm1/run/qemu: Invalid argument
virt-qemu-run: cannot open qemu:///embed?root=vm1: Failed to create state dir vm1/run/qemu: Invalid argument
virt-qemu-run: 52110: cleaned up, exiting

Actual restuls:
'virt-qemu-run' failed to start qemu process with relative root dir. 

Expected results:
Start qemu process with relative root dir successfully. If 'virt-qemu-run' does not support relative root dir, it's better to report a clear error and not try to create directory tree in the relative dir.


Additional info:

Comment 2 Michal Privoznik 2021-03-01 11:51:54 UTC
Patches posted upstream:

https://listman.redhat.com/archives/libvir-list/2021-March/msg00010.html

Comment 3 Michal Privoznik 2021-03-12 15:10:58 UTC
Fixed upstream as:

b1fef73225 virConnectOpen: Require root dir to be absolute path

v7.1.0-195-gb1fef73225

Comment 7 yafu 2021-05-27 01:41:58 UTC
Verified with libvirt-daemon-7.3.0-1.module+el8.5.0+11004+f4810536.x86_64.

Test steps:
1.#cd /var/tmp/

2.#mkdir vm1

3.#setenforce 0; virt-qemu-run -d -v  /root/vm1.xml  -r vm1
virt-qemu-run: 73: initializing libvirt 104907
virt-qemu-run: 2022: initializing signal handlers
virt-qemu-run: 2126: preparing event loop thread
virt-qemu-run: 2218: opening qemu:///embed?root=vm1
virt-qemu-run: cannot open qemu:///embed?root=vm1: unsupported configuration: root path must be absolute
virt-qemu-run: 2584: cleaned up, exiting

Comment 9 errata-xmlrpc 2021-11-16 07:51:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (virt:av bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4684


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