免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 14072 | 回复: 2
打印 上一主题 下一主题

[KVM] qemu-system 启动错误“drive with bus=0, unit=0 (index=0) exists” [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-06-23 01:24 |只看该作者 |倒序浏览
本帖最后由 lonelysoul011 于 2014-06-23 01:45 编辑

RT

错误信息如下:
使用了ifname
  1. qemu-system-x86_64 -m 4096 -smp 4  -hda /root/kvm_demo/rhel58-test.img  -net nic,model=e1000 -net tap,ifname=tap1,script=/etc/qemu-ifup downscript=no  -vnc 172.28.18.244:1:5901
  2. qemu-system-x86_64: -net tap,ifname=tap1,script=/etc/qemu-ifup: drive with bus=0, unit=0 (index=0) exists
复制代码
未使用ifname
  1. qemu-system-x86_64 -m 4096 -smp 4  -hda /root/kvm_demo/rhel58-test.img  -net nic,model=e1000 -net tap,script=/etc/qemu-ifup downscript=no  -vnc 172.28.18.244:1:5901
  2. qemu-system-x86_64: -net tap,script=/etc/qemu-ifup: drive with bus=0, unit=0 (index=0) exists
复制代码
其他测试:
  1. [root@localhost ~]# qemu-system-x86_64 -m 4096 -smp 4  -hda /root/kvm_demo/rhel58-test.img  -net nic,model -net tap,script=/etc/qemu-ifup downscript=no  -vnc 172.28.18.244:1:5901
  2. qemu-system-x86_64: -net tap,script=/etc/qemu-ifup: drive with bus=0, unit=0 (index=0) exists
  3. [root@localhost ~]# qemu-system-x86_64 -m 4096 -smp 4  -hda /root/kvm_demo/rhel58-test.img  -net nic,model=rtl8139 -net tap,script=/etc/qemu-ifup downscript=no  -vnc 172.28.18.244:1:5901
  4. qemu-system-x86_64: -net tap,script=/etc/qemu-ifup: drive with bus=0, unit=0 (index=0) exists
复制代码
宿主机:CentOS release 6.5 X64
QEMU emulator version 1.2.50 (qemu-kvm-devel)
内核版本
Linux localhost.localdomain 3.15.0-rc4+ #2 SMP Fri May 23 12:44:16 GMT 2014 x86_64 x86_64 x86_64 GNU/Linux

启动脚本:
  1. [root@localhost ~]# cat /etc/qemu-ifup
  2. #!/bin/sh
  3. switch=br0

  4. if [ -n "$1" ]
  5. then
  6.     #tunctl -u $(whoami) -t $1
  7.     # start up the TAP interface
  8.     #ifconfig $1 up
  9.      ip link set $1 up
  10.     sleep 1
  11.     brctl addif ${switch} $1
  12.     exit 0
  13. else
  14.     echo "Error: no interface specified"
  15.     exit 1
  16. fi
复制代码
宿主机网络状态:
  1. [root@localhost ~]# brctl  show
  2. bridge name        bridge id                STP enabled        interfaces
  3. br0                8000.c81f66eded6b        yes                em1
复制代码
dmesg信息
  1. [root@localhost ~]# dmesg
  2. device tap0 entered promiscuous mode
  3. br0: port 2(tap0) entered listening state
  4. br0: port 2(tap0) entered listening state
  5. br0: port 2(tap0) entered disabled state
  6. device tap0 left promiscuous mode
  7. br0: port 2(tap0) entered disabled state
复制代码
messages 信息
  1. [root@localhost ~]# tail /var/log/messages -f

  2. Jun 22 17:44:34 localhost kernel: device tap0 entered promiscuous mode
  3. Jun 22 17:44:34 localhost kernel: br0: port 2(tap0) entered listening state
  4. Jun 22 17:44:34 localhost kernel: br0: port 2(tap0) entered listening state
  5. Jun 22 17:44:34 localhost kernel: br0: port 2(tap0) entered disabled state
  6. Jun 22 17:44:34 localhost kernel: device tap0 left promiscuous mode
  7. Jun 22 17:44:34 localhost kernel: br0: port 2(tap0) entered disabled state
复制代码
出现问题后重启过一次,问题依旧!

论坛徽章:
1
摩羯座
日期:2014-08-04 14:50:06
2 [报告]
发表于 2014-06-29 14:14 |只看该作者
host:CentOS-6.5-x86_64
qemu: QEMU emulator version 1.4.2

/usr/local/bin/qemu-system-x86_64 -name win7_x86 -hda win7_x86.qcow2 -boot c -m 1024  -spice port=5911,disable-ticketing -enable-kvm -vga qxl  -net nic,model=e1000 -net tap,ifname=tap1,script=/etc/qemu-ifup

#cat /etc/qemu-ifup
  1. #!/bin/sh
  2. switch=br0

  3. if [ -n "$1" ]
  4. then
  5.     ip link set $1 up
  6.     sleep 1
  7.        
  8.     /usr/sbin/brctl addif ${switch} $1
  9.        
  10.     exit 0
  11. else
  12.     echo "Error: no interface specified"
  13.     exit 1
  14. fi
复制代码
我这边是可以的。看代码,跟磁盘参数的解析有关,但是看你的运行参数,又没有冲突。
可以把-hda 换成  -hdb -hdc -hdd 试试。

论坛徽章:
0
3 [报告]
发表于 2014-07-16 14:19 |只看该作者
downscript=***前面是不是少了一个逗号 把-hda 的内容放到最后面 qemu-system-x86_64 -h上面有参数顺序,需要参照一下
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP