On Tue, Aug 27, 2019 at 02:13:28PM +0200, Michal Privoznik wrote:
On 8/22/19 10:43 AM, Xu Yandong (Yandong Xu) wrote:Hi, When plug a bridge interface to an active VM with both LIVE AND CONFIG flags, libvirt generate different mac address to LIVE and CONFIG instance, so After I reboot the VM, DHCP server doesn't assign the same IP address to the new bridge interface.This is kind of expected. In general, live and inactive XMLs can be significantly different.
Well, if the live and inactive XMLs have sufficiently diverged, then I don't see the point of calling AttachDevice with both AFFECT_LIVE and AFFECT_CONFIG - you might as well use two different API calls. However for a guest with the definitions in sync, quietly accepting a both flags while attaching a device with different MAC addresses (so essentially two different devices) feels wrong.
And I guess it's out of libvirt's scope to try and autofill missing data in such way that fits both libe and inactive XMLs. For instance, a PCI address can be taken/free in live XML because of hotplug/hotunplug but that might not be the case for inactive XML. Should libvirt try and find a slot that suits both XMLs?
That possibly might be out of scope, but autofilling the mac address as early as virDomainNetDefParseXML also is not ideal. Jano
Michal -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list
Attachment:
signature.asc
Description: PGP signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list