|
|
楼主 |
发表于 2019-9-19 14:05:30
|
显示全部楼层
解决办法:
- F9 z; }: {+ _3 C& I Q通过virsh edit 修改xml文件,添加如下信息,即可:
: ?% k l# p5 ]) E6 K" `8 c <interface type='bridge'>; }) p3 T. z& ~. i' V
<mac address='52:54:00:af:49:04'/>- h* _4 `7 T4 d1 D- q a8 ^9 Z1 H
<source bridge='vpc-connection'/>+ W, |) b% \. |# z! k6 u8 V- u6 e
<target dev='peer-175.73'/>; @; Y: t9 D: ?1 F: t/ V" g
<model type='virtio'/> H( v+ h, R- t; |1 C- D' A- i
<driver name='qemu'/>
( Y0 ?+ F H }3 B) W) m1 f <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
) V8 Q6 ^ A2 u- R1 e4 p </interface>
& V- m/ ~2 [! i& k4 g6 a <serial type='pty'>, Y0 J( b8 i8 P& x
<target port='0'/>
6 ]. a4 K8 P" ~ </serial>3 R7 _+ p& E" {/ f& Q& M4 ^
<console type='pty'>
& Y+ ~# {2 e3 f: u' v: |4 z! f0 q, u3 e <target type='serial' port='0'/>
, p) u) [# }7 w9 L& w) f </console>1 l- @8 @/ t* \3 T( x8 Z$ A! f
<channel type='spicevmc'>
3 k% K$ \9 i: G! p# _: ^ <target type='virtio' name='com.redhat.spice.0'/>
. f# V6 a: W7 H" X <address type='virtio-serial' controller='0' bus='0' port='1'/>! C! N8 T2 u4 Y, g
</channel>
7 \, R. w# X+ t" V修改完成后保存:
( J, o3 k7 _) Z+ v# |( Vvi /etc/libvirt/qemu/xxx.xml文件的配置信息是否正确
3 E, Q/ u+ A6 z8 H5 }5 R" ]( A9 s3 M( M1 {8 c1 ?; \8 T
5 i7 e% Z! [" A7 H/ c7 h2 p
重启kvm虚机:" K9 l2 R. |4 m# {% ?6 {5 `( ]$ W' R
virsh destroy xxx
9 a1 I- }* T+ Q& ^4 F7 D) p( v) H) Tvirsh start xxx- Q0 x3 ~( } R2 P0 ~
|
|