• L
    conf: utility function to update entry in def->nets array · 7e490cda
    Laine Stump 提交于
    A virDomainNetDef object in a domain's nets array might contain a
    virDomainHostdevDef, and when this is the case, the domain's hostdevs
    array will also have a pointer to this embedded hostdev (this is done
    so that internal functions that need to perform some operation on all
    hostdevs won't leave out the type='hostdev' network interfaces).
    
    When a network device was updated with virDomainUpdateDeviceFlags(),
    we were replacing the entry in the nets array (and free'ing the
    original) but forgetting about the pointer in the hostdevs array
    (which would then point to the now-free'd hostdev contained in the old
    net object.) This often resulted in a libvirtd crash.
    
    The solution is to add a function, virDomainNetUpdate(), called by
    qemuDomainUpdateDeviceConfig(), that updates the hostdevs array
    appropriately along with the nets array.
    
    Resolves: https://bugzilla.redhat.com/1558934Signed-off-by: NLaine Stump <laine@redhat.com>
    Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
    7e490cda
lxc_driver.c 163.7 KB