我使用 libvirt + qemu 用带有 IDE 总线的磁盘启动虚拟机
libvirt 中的设备:
<disk type='network' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source protocol='iscsi' name='xxx'>
<host name='127.0.0.1' port='xxx'/>
</source>
<target dev='hdb' bus='ide'/>
<boot order='3'/>
<alias name='ide0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
在qem中:
-drive file.driver=iscsi,file.portal=127.0.0.1:xxx,file.target=xxx,file.lun=xxx,file.transport=tcp,format=raw,if=none,id=drive-ide0-0-1,cache=none,aio=native
-device ide-hd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1,bootindex=3,write-cache=on
来宾操作系统是 CentOS-7.9-x86_64-DVD-2009
开机后,dmesg中的显示显示
May 18 06:07:37 localhost kernel: ata1: PATA max MWDMA2 cmd 0x1f0 ctl 0x3f6 bmdma 0xd120 irq 14
May 18 06:07:37 localhost kernel: ata2: PATA max MWDMA2 cmd 0x170 ctl 0x376 bmdma 0xd128 irq 15
May 18 09:15:54 localhost kernel: ata1.00: ATAPI: QEMU DVD-ROM, 2.5+, max UDMA/100
May 18 09:15:54 localhost kernel: ata1.01: ATA-7: QEMU HARDDISK, 2.5+, max UDMA/100
May 18 09:15:54 localhost kernel: ata1.01: 6291456 sectors, multi 16: LBA48
May 18 09:15:54 localhost kernel: ata1.00: configured for MWDMA2
May 18 09:15:54 localhost kernel: ata1.01: configured for MWDMA2
May 18 09:15:54 localhost kernel: scsi 0:0:0:0: CD-ROM QEMU QEMU DVD-ROM 2.5+ PQ: 0 ANSI: 5
May 18 09:15:54 localhost kernel: scsi 0:0:1:0: Direct-Access ATA QEMU HARDDISK 2.5+ PQ: 0 ANSI: 5
May 18 09:15:54 localhost kernel: sr 0:0:0:0: [sr0] scsi3-mmc drive: 4x/4x cd/rw xa/form2 tray
May 18 09:15:54 localhost kernel: cdrom: Uniform CD-ROM driver Revision: 3.20
May 18 09:15:54 localhost kernel: sd 0:0:1:0: [sda] 6291456 512-byte logical blocks: (3.22 GB/3.00 GiB)
May 18 09:15:54 localhost kernel: sd 0:0:1:0: [sda] Write Protect is off
May 18 09:15:54 localhost kernel: sd 0:0:1:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
May 18 09:15:54 localhost kernel: sd 0:0:1:0: [sda] Attached SCSI disk
并在 lshw 中显示
[root@localhost ~]# lshw -class disk
*-cdrom
description: DVD reader
product: QEMU DVD-ROM
vendor: QEMU
physical id: 0.0.0
bus info: scsi@0:0.0.0
logical name: /dev/cdrom
logical name: /dev/sr0
version: 2.5+
capabilities: removable audio dvd
configuration: ansiversion=5 status=ready
*-medium
physical id: 0
logical name: /dev/cdrom
capabilities: partitioned partitioned:dos
configuration: signature=6b8b4567
*-disk
description: ATA Disk
product: QEMU HARDDISK
physical id: 0.1.0
bus info: scsi@0:0.1.0
logical name: /dev/sda
version: 2.5+
serial: 918a6997-1928-38a1-9
size: 3GiB (3221MB)
configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512
为什么 CentOS 将 ATA 总线转换为 scsi 总线?我在哪里可以看到更相关的描述?