1. 16 3月, 2015 18 次提交
  2. 15 3月, 2015 2 次提交
    • E
      network: avoid memory leak of dnsmasq capabilities · eea08abe
      Eric Blake 提交于
      Valgrind detected a leak:
      
      ==17820== 102 (56 direct, 46 indirect) bytes in 1 blocks are definitely lost in loss record 479 of 646
      ==17820==    at 0x4A08946: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==17820==    by 0x508521A: virAllocVar (viralloc.c:560)
      ==17820==    by 0x50D9FCA: virObjectNew (virobject.c:193)
      ==17820==    by 0x50A4FD9: dnsmasqCapsNewEmpty (virdnsmasq.c:784)
      ==17820==    by 0x50A514E: dnsmasqCapsNewFromBinary (virdnsmasq.c:830)
      ==17820==    by 0x1B508287: networkStateInitialize (bridge_driver.c:666)
      
      It looks like commit 172acef4 introduced the problem, because
      networkGetDnsmasqCaps() increments the reference count but an
      early exit never does a matching decrement.
      
      * src/network/bridge_driver.c (networkStateCleanup): Plug leak.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      eea08abe
    • E
      netdev: silence valgrind warning about ioctl use · a9abc08d
      Eric Blake 提交于
      Valgrind complained:
      
      ==3770== Syscall param ioctl(SIOCETHTOOL) points to uninitialised byte(s)
      ==3770==    at 0x919D407: ioctl (syscall-template.S:81)
      ==3770==    by 0x530FE7E: rpl_ioctl (ioctl.c:42)
      ==3770==    by 0x50CB433: virNetDevFeatureAvailable (virnetdev.c:2764)
      ==3770==    by 0x50CB6A7: virNetDevGetFeatures (virnetdev.c:2830)
      ==3770==    by 0x1F0E5347: udevProcessNetworkInterface (node_device_udev.c:722)
      ==3770==    by 0x1F0E689F: udevGetDeviceDetails (node_device_udev.c:1300)
      ==3770==    by 0x1F0E6E06: udevAddOneDevice (node_device_udev.c:1422)
      ==3770==    by 0x1F0E6FB8: udevProcessDeviceListEntry (node_device_udev.c:1464)
      ==3770==    by 0x1F0E70CF: udevEnumerateDevices (node_device_udev.c:1494)
      ==3770==    by 0x1F0E7BB4: nodeStateInitialize (node_device_udev.c:1806)
      ==3770==    by 0x51B4303: virStateInitialize (libvirt.c:777)
      ==3770==    by 0x11DEE7: daemonRunStateInit (libvirtd.c:906)
      ==3770==  Address 0x228e38d4 is on thread 12's stack
      ==3770==  in frame #2, created by virNetDevFeatureAvailable (virnetdev.c:2750)
      
      * src/util/virnetdev.c (virNetDevFeatureAvailable): Initialize all
      bytes of ifr.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      a9abc08d
  3. 14 3月, 2015 5 次提交
    • Z
      util: don't fail if no PortData is found while getting migrateData · 25df57db
      zhang bo 提交于
      Introduced by f6a2f97e
      
      Problem Description:
      After multiple times of migrating a domain, which has an ovs interface with no portData set,
      with non-shared disk, nbd ports got overflowed.
      
      The steps to reproduce the problem:
      1 define and start a domain with its network configured as:
          <interface type='bridge'>
                <source bridge='br0'/>
                <virtualport type='openvswitch'>
                </virtualport>
                <model type='virtio'/>
                <driver name='vhost' queues='4'/>
          </interface>
      2 do not set the network's portData.
      3 migrate(ToURI2) it with flag 91(1011011), which means:
        VIR_MIGRATE_LIVE
        VIR_MIGRATE_PEER2PEER
        VIR_MIGRATE_PERSIST_DEST
        VIR_MIGRATE_UNDEFINE_SOURCE
        VIR_MIGRATE_NON_SHARED_DISK
      4 migrate success, but we got an error log in libvirtd.log:
        error : virCommandWait:2423 : internal error: Child process (ovs-vsctl --timeout=5 get Interface
        vnet1 external_ids:PortData) unexpected exit status 1: ovs-vsctl: no key "PortData" in Interface
        record "vnet1" column external_ids
      5 migrate it back, migrate it , migrate it back, .......
      6 nbd port got overflowed.
      
      The reasons for the problem is :
      1 virNetDevOpenvswitchGetMigrateData() takes it as wrong if no portData is available for  the ovs
       interface of a domain. (We think it's not appropriate, as portData is just OPTIONAL)
      2 in func qemuMigrationBakeCookie(), it fails in qemuMigrationCookieAddNetwork(), and returns with -1.
       qemuMigrationCookieAddNBD() is not called thereafter, and mig->nbd is still NULL.
      3 However, qemuMigrationRun() just *WARN* if qemuMigrationBakeCookie() fails, migration still successes.
       cookie is NULL, it's not baked on the src side.
      4 On the destination side, it would alloc a port first and then free the nbd port in COOKIE.
       But the cookie is NULL due to qemuMigrationCookieAddNetwork() failure at src side. thus the nbd port
       is not freed.
      
      In this patch, we add "--if-exists" option to make ovs-vsctl not raise error if there's no portData available.
      Further more, because portData may be NULL in the cookie at the dest side, check it before setting portData.
      Signed-off-by: NZhou Yimin <zhouyimin@huawei.com>
      Signed-off-by: NZhang Bo <oscar.zhangbo@huawei.com>
      25df57db
    • M
      libxl: prevent attaching multiple netdevs with the same MAC · 1a01a2aa
      Marek Marczykowski-Górecki 提交于
      It will not be possible to detach such device later. Also improve
      logging in such cases.
      Signed-off-by: NMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
      1a01a2aa
    • M
      conf: add virDomainHasNet · ed4db85a
      Marek Marczykowski-Górecki 提交于
      virDomainNetFindIdx no longer returns info whether device was not found,
      or there was multiple matches. Additionally it already handle error
      reporting. Introduce virDomainHasNet which does a simple task, without
      implicit error reporting.
      Signed-off-by: NMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
      ed4db85a
    • M
      xenconfig: add support for multiple USB devices syntax · cd5dc303
      Marek Marczykowski-Górecki 提交于
      In Xen>=4.3, libxl supports new syntax for USB devices:
      usbdevice=[ "DEVICE", "DEVICE", ... ]
      Add support for that in xenconfig driver. When only one device is
      defined, keep using old syntax for backward compatibility.
      
      Adjust tests for changed options order.
      Signed-off-by: NMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
      cd5dc303
    • M
  4. 13 3月, 2015 12 次提交
  5. 12 3月, 2015 3 次提交