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

Re: [libvirt-users] [libvirt] Why virsh domxml-to-native qemu-argv changes PCI slot number



On Thu, Apr 18, 2019 at 04:23:05PM +0200, Andrea Bolognani wrote:
> Moving to libvirt-users where it belongs.
> 
> On Thu, 2019-04-18 at 06:47 +0000, Tal Attaly wrote:
> > Hi,
> > I have bridge type interface defined with slot 3 -
> > <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
> > but after running virsh domxml-to-native qemu-argv I get slot 2-
> > -netdev tap,fd=21,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=f2:ff:ff:ff:ff:07,bus=pci.0,addr=0x2
> > Any idea why it's happen and how to keep the slot number?  Libvirt version is 4.5.0
> 
> I can reproduce this, and also confirm that it shouldn't happen :)
> 
> qemuDomainAssignAddresses() is supposed to make sure that any address
> configured explicitly by the user (or previously by libvirt) is
> preserved, and it's doing that correctly when it's called from inside
> qemuDomainDefAssignAddresses(); however, for some reason, by the time
> we call it again in qemuProcessPrepareDomain() the PCI address for
> the network interface is no longer set, and so a fresh one gets
> assigned instead.
> 
> I'll investigate further and get back to you.

It is a bug in qemuConnectDomainXMLToNative. You'll see we replace
the original type=bridge NIC with a type=ethernet, except we fail
to copy the address info & probably other properties too.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


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