[vfio-users] optical eject issue

Roger Lawhorn rll at twc.com
Sat May 23 05:12:26 UTC 2020


ok, sorry, did a reply instead of a reply to all....

I have used the -cdrom /dev/sr0 option.
When you say 'virtual' optical drive, are you talking about an iso or a 
physical optical drive?
I am adding a physical optical drive.
I launch qemu using a script.
The script is passed the number of cpus to let qemu have ($1).
The ISO I setup as a cdrom shows up as drive D:
The physical optical drive shows up as drive F:

Like I said, the ejection issues really suck.

Here is my script:
#!/bin/bash
cd /media/dad/QEMU-SSD/qemu-wd
export QEMU_AUDIO_DRV=pa
export QEMU_AUDIO_TIMER_PERIOD=200
export QEMU_PA_SERVER=/run/user/1000/pulse/native

taskset -p -c 0-7 `pidof lightdm | cut -d' ' -f2`
taskset -c 8-23 qemu4.0-system-x86_64 -machine type=q35,accel=kvm -cpu 
EPYC \
-chardev stdio,id=seabios -device 
isa-debugcon,iobase=0x402,chardev=seabios \
-smp $1,sockets=1,cores=$1 \
-bios /usr/share/seabios/bios.bin \
-m 16G \
-vga none \
-soundhw hda \
-mem-prealloc \
-rtc clock=host,base=localtime \
-device 
ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device 
vfio-pci,host=0d:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
-device vfio-pci,host=0d:00.1,bus=root.1,addr=00.1,multifunction=on \
-device vfio-pci,host=0e:00.0,bus=root.1,addr=00.2,multifunction=on \
-device virtio-scsi-pci,id=scsi \
-drive 
id=disk0,if=virtio,cache=none,format=raw,file=/media/dad/QEMU-SSD/qemu-wd/windows10.img 
\
-drive 
file=/media/dad/QEMU-SSD/qemu-wd/'Win10_1909_English_x64.iso',id=isocd,format=raw,if=none 
-device scsi-cd,drive=isocd \
-netdev type=tap,id=net0,ifname=tap0 \
-device virtio-net-pci,netdev=net0,mac=00:16:3e:00:01:01 \
-usb -device usb-host,vendorid=0x046d,productid=0xc534 \
-usb -device usb-host,vendorid=0x05ac,productid=0x12aa \
-usb -device usb-host,vendorid=0x21c4,productid=0x0cd1 \
-cdrom /dev/sr0 \
-boot menu=on \
-boot order=c
exit 0


On 5/19/20 5:30 AM, leesteken at pm.me wrote:
> On Tuesday, May 19, 2020 1:05 AM, Roger Lawhorn <rll at twc.com> wrote:
>
>> When I add an optical drive to qemu the following happens:
>>
>> 1.  the drive and any disc is seen and works.
>> 2.  If I eject the disc and insert a new one the neew disc cannot be seen
>>      unless a full reboot of windows is performed.
>>
>>      Is this normal behaviour?
>>      Is there a fix for this?
> Never noticed this problem. I always connect a virtual optical drive to a virtio SCSI-controller,
> which works fine on Windows 10 after installing the driver. Disc changes are detected instantly.
>
>>      Thanks
>>
>>      Using QEMU 4.x
>>
>>
>> vfio-users mailing list
>> vfio-users at redhat.com
>> https://www.redhat.com/mailman/listinfo/vfio-users
>




More information about the vfio-users mailing list