无法添加更多磁盘/网卡

虚拟化 虚拟化 2123 人阅读 | 7 人回复 | 2021-05-15

本帖最后由 eagle 于 2021-5-15 14:05 编辑

vm关机后,添加一张网卡 一个磁盘

开机报错

xml

root@deepin-PC:/var/lib/nova/instances/4370116d-4b22-4a4e-9a5c-27d03f7bdbec# virsh  dumpxml 4370116d-4b22-4a4e-9a5c-27d03f7bdbec  |grep slot
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>

多了一个ich9-ahci, 如果添加设备超过10个,就报错
2021-04-15T03:17:56.398308Z qemu-system-sw64: -device virtio-keyboard-pci,id=input1,bus=pci.0,addr=0xa: PCI: slot 10 function 0 not available for virtio-keyboard-pci, in use by ich9-ahci


virsh  qemu-monitor-command 79 --hmp info qtree

      dev: ich9-ahci, id ""
        addr = 0a.0
        romfile = ""
        rombar = 1 (0x1)
        multifunction = true
        command_serr_enable = true
        x-pcie-lnksta-dllla = true
        x-pcie-extcap-init = true
        class SATA controller, addr 00:0a.0, pci id 8086:2922 (sub 1af4:1100)
        bar 4: i/o at 0xc00 [0xc1f]
        bar 5: mem at 0xc0044000 [0xc0044fff]
        bus: ide.5
          type IDE
        bus: ide.4
          type IDE
        bus: ide.3
          type IDE
        bus: ide.2
          type IDE
        bus: ide.1
          type IDE
        bus: ide.0


回复

使用道具 举报

回答|共 7 个

eagle

发表于 2021-5-15 20:20:14 | 显示全部楼层

只要设备多余11个就会有问题
回复

使用道具 举报

TecSupport

发表于 2021-5-17 11:36:40 | 显示全部楼层

好像最多添加8个设备,我来确认一下
回复

使用道具 举报

eagle

发表于 2021-5-17 11:43:22 | 显示全部楼层

TecSupport 发表于 2021-5-17 11:36
好像最多添加8个设备,我来确认一下

多谢,如果是8个,后面有计划去掉这个限制吗
回复

使用道具 举报

Duy

发表于 2021-5-17 15:54:40 | 显示全部楼层

经测试,在xml文件为device的slot分配0xa时,报PCI: slot 10 function 0 not available for virtio-keyboard-pci, in use by ich9-ahci,为slot分配0xb,0xc等启动虚拟机正常。因ich9-ahci设备初始化时占用0xa,参考x86架构将ICH9-AHCI默认slot修改为0x1f。
回复

使用道具 举报

TecSupport

发表于 2021-5-18 09:50:10 | 显示全部楼层

eagle 发表于 2021-5-17 11:43
多谢,如果是8个,后面有计划去掉这个限制吗

按照测试结果,数量没有限制,报错是因为地址被占用所致,请验证一下
回复

使用道具 举报

alvin 该用户已被删除

发表于 2021-9-3 17:48:14 | 显示全部楼层

提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

TecSupport

发表于 2022-5-16 10:22:08 | 显示全部楼层

alvin 发表于 2021-9-3 17:48
**** 作者被禁止或删除 内容自动屏蔽 ****

libvirt用v5.0.0-sw-2107-rc2版本,肯定支持的。iso版本需要跟os厂商要
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则