1. 27 9月, 2019 1 次提交
    • 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
  2. 26 9月, 2019 1 次提交
    • M
      domain_conf: Unref video private data in virDomainVideoDefClear() · 4e9d72be
      Michal Privoznik 提交于
      The private data for video definition is created in
      virDomainVideoDefNew() and we attempt to free it in
      virDomainVideoDefFree(). This seems to work, except
      the free function calls clear function which zeroes
      out the whole structure and thus virObjectUnref()
      which is called on private data does nothing.
      
      2,568 bytes in 107 blocks are definitely lost in loss record 207 of 213
         at 0x4A35476: calloc (vg_replace_malloc.c:752)
         by 0x50A6048: virAllocVar (viralloc.c:346)
         by 0x513CC5A: virObjectNew (virobject.c:243)
         by 0x4DC1DEE: qemuDomainVideoPrivateNew (qemu_domain.c:1337)
         by 0x51A6BD6: virDomainVideoDefNew (domain_conf.c:2831)
         by 0x51B9F06: virDomainVideoDefParseXML (domain_conf.c:15541)
         by 0x51CB761: virDomainDefParseXML (domain_conf.c:21158)
         by 0x51C5973: virDomainDefParseNode (domain_conf.c:21708)
         by 0x51C583A: virDomainDefParse (domain_conf.c:21663)
         by 0x51C58AE: virDomainDefParseFile (domain_conf.c:21688)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      4e9d72be
  3. 25 9月, 2019 38 次提交