Domain fails to start when 'readonly' device not writable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
This issue is introduced in QEMU 4.2.0 (4.1.0 is working fine)
My root disk is a LVM2 volume thin snapshot that is marked as read-only
But when I try to start the domain (using virt-manager) I get the following error:
Error starting domain: internal error: process exited while connecting to monitor: 2020-04-
Changing the lvm snapshot to writeable allows me to start the domain.
(Making it changes possible during domain is running)
I don't think QEMU should fail when it can't open a (block) device when the read-only option is set.
(why is write access needed?)
Reproduce steps:
* Create LVM read-only volume (I don't think any data is needed)
* Create domain with read-only volume as block device
* Try to start the domain
Traceback (most recent call last): virt-manager/ virtManager/ asyncjob. py", line 75, in cb_wrapper asyncjob, *args, **kwargs) virt-manager/ virtManager/ asyncjob. py", line 111, in tmpcb virt-manager/ virtManager/ object/ libvirtobject. py", line 66, in newfn virt-manager/ virtManager/ object/ domain. py", line 1279, in startup _backend. create( ) python3. 7/site- packages/ libvirt. py", line 1152, in create libvirtError: internal error: process exited while connecting to monitor: 2020-04- 26T07:29: 47.463835Z qemu-system-x86_64: -blockdev {"driver" :"host_ device" ,"filename" :"/var/ lib/libvirt/ vmportage/ rootdisk" ,"aio": "native" ,"node- name":" libvirt- 3-storage" ,"cache" :{"direct" :true," no-flush" :false} ,"auto- read-only" :true," discard" :"unmap" }: The device is not writable: Permission denied
File "/usr/share/
callback(
File "/usr/share/
callback(*args, **kwargs)
File "/usr/share/
ret = fn(self, *args, **kwargs)
File "/usr/share/
self.
File "/usr/lib/
if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirt.