Using disk XML
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<source dev='/dev/sr0'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
And no media in the host CDROM, booting fails like:
error: cannot open file '/dev/sr0': No medium found
This is coming from:
qemu_command.c:qemuDomainDetermineDiskChain->virStorageFileGetMetadata
Easy-ish fix is to use O_NONBLOCK when opening the path, but then trying to read the non-existing file header later on just fails with an i/o error.
qemu has handled this for a while by trying to detect host devices and altering open flags appropriately, see the *probe* functions here:
http://git.qemu.org/?p=qemu.git;a=blob;f=block/raw-posix.c
This is something we explicitly made work in qemu in the past due to user request, so it'd be nice to get it working again.