qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Zhipeng Lu
Subject: Re: [PATCH] blockdev: add 'media=cdrom' argument to support usb cdrom emulated as cdrom
Date: Fri, 9 Dec 2022 10:28:23 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1

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, support hotplug and unplug, not depend on virtio driver

have a better idea?

在 2022/12/7 16:39, 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 <drive> element.

Paolo

Il sab 3 dic 2022, 13:52 Zhipeng Lu <luzhipeng@cestc.cn <mailto:luzhipeng@cestc.cn>> ha scritto:

    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 /boot
     >> └─vda2        252:2    0    9G  0 part
     >>    ├─rhel-root 253:0    0    8G  0 lvm  /
     >>    └─rhel-swap 253:1    0    1G  0 lvm  [SWAP]
     >> lshw -short|grep cdrom -i
     >> No cdrom.
     >>
     >> My patch is to solve this problem, usb cdrom emulated as cdrom.
     >
     > This is a libvirt bug, it should use usb-bot instead of usb-storage
     > together with -blockdev.  Then it can add a scsi-cd device below
    usb-bot.
     >
     > Paolo
     >
     >>
     >>
     >> 在 2022/12/1 23:35, Markus Armbruster 写道:
     >>> luzhipeng <luzhipeng@cestc.cn <mailto:luzhipeng@cestc.cn>> writes:
     >>>
     >>>> From: zhipeng Lu <luzhipeng@cestc.cn <mailto:luzhipeng@cestc.cn>>
     >>>>
     >>>> 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 <luzhipeng@cestc.cn
    <mailto:luzhipeng@cestc.cn>>
     >>>
     >>> What problem are you trying to solve?
     >>>
     >>>
     >>>
     >>
     >>
     >>
     >
     >
     >







reply via email to

[Prev in Thread] Current Thread [Next in Thread]