[PATCH] blockdev: add 'media=cdrom' argument to support usb cdrom emulated as cdrom

2022-12-01 Thread luzhipeng
From: zhipeng Lu The drive interface supports media=cdrom so that the usb cdrom can be emulated as cdrom in qemu, but libvirt deprived the drive interface, so media=cdrom is added to the blockdev interface to support usb cdrom emulated as cdrom Signed-off-by: zhipeng Lu --- block.c

Re: [PATCH] blockdev: add 'media=cdrom' argument to support usb cdrom emulated as cdrom

2022-12-01 Thread Markus Armbruster
luzhipeng writes: > From: zhipeng Lu > > The drive interface supports media=cdrom so that the usb cdrom > can be emulated as cdrom in qemu, but libvirt deprived the drive > interface, so media=cdrom is added to the blockdev interface to > support usb cdrom emulated as cdrom > > Signed-off-by: zh

Re: [PATCH] blockdev: add 'media=cdrom' argument to support usb cdrom emulated as cdrom

2022-12-01 Thread Zhipeng Lu
libvirt issue: https://gitlab.com/libvirt/libvirt/-/issues/261 1、start vm with usb cdrom 2、 get qemu cmdline qemu ... -blockdev {"driver":"file","filename":"/tmp/cdrom","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libv

Re: [PATCH] blockdev: add 'media=cdrom' argument to support usb cdrom emulated as cdrom

2022-12-02 Thread Paolo Bonzini
On 12/2/22 03:26, Zhipeng Lu wrote: NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT sda 8:0    0  100M  1 disk vda   252:0    0   10G  0 disk ├─vda1    252:1    0    1G  0 part /boot └─vda2    252:2    0    9G  0 part   ├─rhel-root 253:0    0    8G  0 lvm  /   └─rh

Re: [PATCH] blockdev: add 'media=cdrom' argument to support usb cdrom emulated as cdrom

2022-12-03 Thread Zhipeng Lu
Could you give the detail qemu cmdline about usb-bot? 在 2022/12/2 17:40, Paolo Bonzini 写道: On 12/2/22 03:26, Zhipeng Lu wrote: NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT sda 8:0    0  100M  1 disk vda   252:0    0   10G  0 disk ├─vda1    252:1    0    1G  0 part /

Re: [PATCH] blockdev: add 'media=cdrom' argument to support usb cdrom emulated as cdrom

2022-12-07 Thread Paolo Bonzini
It should be like this: -device usb-bot,id=bot0 -device scsi-{cd,hd},bus=bot0.0,drive=drive0 Libvirt has the code to generate the options for SCSI controllers, but usb-bot only allows one disk attached to it so it's easier to make it a element. Paolo Il sab 3 dic 2022, 13:52 Zhipeng Lu ha scr

Re: [PATCH] blockdev: add 'media=cdrom' argument to support usb cdrom emulated as cdrom

2022-12-08 Thread Zhipeng Lu
Thanks. -device usb-bot,id=bot0 -device scsi-{cd,hd},bus=bot0.0,drive=drive0 Qemu implements virtio scsi to emulate scsi controller, but if the virtual machine(for example windows guest os) don't install the virtio scsi driver, it don't work i need the function: emulate cdrom in guest, suppo

Re: [PATCH] blockdev: add 'media=cdrom' argument to support usb cdrom emulated as cdrom

2022-12-09 Thread Paolo Bonzini
On 12/9/22 03:28, Zhipeng Lu wrote: Thanks.  -device usb-bot,id=bot0  -device scsi-{cd,hd},bus=bot0.0,drive=drive0 Qemu implements virtio scsi to emulate scsi controller, but if the virtual machine(for example windows guest os) don't install the virtio scsi driver, it don't work i need the