1. 19 3月, 2015 1 次提交
  2. 18 3月, 2015 5 次提交
  3. 17 3月, 2015 1 次提交
  4. 15 3月, 2015 1 次提交
    • 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
  5. 14 3月, 2015 1 次提交
    • 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
  6. 13 3月, 2015 2 次提交
    • J
      Introduce virBitmapIsBitSet · 22fd3ac3
      Ján Tomko 提交于
      A helper that never returns an error and treats bits out of bitmap range
      as false.
      
      Use it everywhere we use ignore_value on virBitmapGetBit, or loop over
      the bitmap size.
      22fd3ac3
    • P
      virnetdev: fix build with old kernel · 48461b16
      Pavel Hrdina 提交于
      Commit c9027d8f added a detection of NIC HW features, but some of them
      are not available in old kernel.  Very old kernels lack enum
      ethtool_flags and even if this enum is present, not all values are
      available for all kernels.  To be sure that we have everything in kernel
      that we need, we must check for existence of most of that flags, because
      only few of them were defined at first.
      
      Also to successfully build libvirt with older kernel we need to include
      <linux/types.h> before <linux/ethtool.h> to have __u32 and friends
      defined.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      48461b16
  7. 06 3月, 2015 3 次提交
  8. 05 3月, 2015 2 次提交
    • J
      Fix build on mingw · 41c5baea
      Ján Tomko 提交于
      Last commit unconditionally included a linux-specific header.
      
      Do not do that.
      41c5baea
    • J
      SRIOV NIC offload feature discovery · c9027d8f
      James Chapman 提交于
      Adding functionality to libvirt that will allow it
      query the ethtool interface for the availability
      of certain NIC HW offload features
      
      Here is an example of the feature XML definition:
      
      <device>
      <name>net_eth4_90_e2_ba_5e_a5_45</name>
        <path>/sys/devices/pci0000:00/0000:00:03.0/0000:08:00.1/net/eth4</path>
        <parent>pci_0000_08_00_1</parent>
        <capability type='net'>
          <interface>eth4</interface>
          <address>90:e2:ba:5e:a5:45</address>
          <link speed='10000' state='up'/>
          <feature name='rx'/>
          <feature name='tx'/>
          <feature name='sg'/>
          <feature name='tso'/>
          <feature name='gso'/>
          <feature name='gro'/>
          <feature name='rxvlan'/>
          <feature name='txvlan'/>
          <feature name='rxhash'/>
          <capability type='80203'/>
        </capability>
      </device>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      c9027d8f
  9. 26 2月, 2015 4 次提交
    • P
      util: storage: Fix error type in virStorageSourceParseBackingURI · ef2e6f40
      Peter Krempa 提交于
      The gluster volume name extraction code was copied from the XML parser
      without changing the VIR_ERR_XML_ERROR error code. Use
      VIR_ERR_CONFIG_UNSUPPORTED instead.
      ef2e6f40
    • P
      util: storagefile: Don't crash on gluster URIs without path · fc56ecd7
      Peter Krempa 提交于
      Similar to commit fdb80ed4 libvirtd
      would crash if a gluster URI without path would be used in the backing
      chain of a volume. The crash happens in the gluster specific part of the
      parser that extracts the gluster volume name from the path.
      
      Fix the crash by checking that the PATH is NULL.
      
      This patch does not contain a test case as it's not possible to test it
      with the current infrastructure as the test suite would attempt to
      contact the gluster server in the URI. I'm working on the test suite
      addition but that will be post-release material.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1196528
      fc56ecd7
    • L
      util: check for null ifname inside virNetDevBandwidthSet() · 153b06c6
      Laine Stump 提交于
      Previously this function relied on having ATTRIBUTE_NONNULL(1) in its
      prototype rather than explicitly checking for a null
      ifname. Unfortunately, ATTRIBUTE_NONNULL is just a hint to the
      optimizer and code analyzers like Coverity, it doesn't actually check
      anything at execution time, so the result was possible warnings from
      Coverity, along with the possibility of null dereferences when ifname
      wasn't available.
      
      This patch removes the ATTRIBUTE_NONNULL from the prototype, and
      checks ifname inside the function, logging an error if it's NULL (once
      we've determined that the user really is trying to set a bandwidth).
      153b06c6
    • L
      network: only clear bandwidth if it has been set · 118b2408
      Laine Stump 提交于
      libvirt was unconditionally calling virNetDevBandwidthClear() for
      every interface (and network bridge) of a type that supported
      bandwidth, whether it actually had anything set or not. This doesn't
      hurt anything (unless ifname == NULL!), but is wasteful.
      
      This patch makes sure that all calls to virNetDevBandwidthClear() are
      qualified by checking that the interface really had some bandwidth
      setup done, and checks for a null ifname inside
      virNetDevBandwidthClear(), silently returning success if it is null
      (as well as removing the ATTRIBUTE_NONNULL from that function's
      prototype, since we can't guarantee that it is never null,
      e.g. sometimes a type='ethernet' interface has no ifname as it is
      provided on the fly by qemu).
      118b2408
  10. 25 2月, 2015 2 次提交
  11. 19 2月, 2015 1 次提交
    • J
      Search for schemas and cpu_map.xml in source tree · bc6e2063
      Jiri Denemark 提交于
      Not all files we want to find using virFileFindResource{,Full} are
      generated when libvirt is built, some of them (such as RNG schemas) are
      distributed with sources. The current API was not able to find source
      files if libvirt was built in VPATH.
      
      Both RNG schemas and cpu_map.xml are distributed in source tarball.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      bc6e2063
  12. 13 2月, 2015 1 次提交
    • P
      virprocess: fix MinGW build and RHEL-5 build · 94cc5778
      Pavel Hrdina 提交于
      Commit b6a2828e introduced new functions to set process scheduler. There
      is a small typo in ELSE path for systems where scheduler is not
      available.
      
      Also some of the definitions were introduced later in kernel. For
      example RHEL-5 is running on kernel 2.6.18, but SCHED_IDLE was introduces
      in 2.6.23 [1] and SCHED_BATCH in 2.6.16 [1]. We should not count only on
      existence of function sched_setscheduler(), we must also check for
      existence of used macros as they might not be defined.
      
      [1] see 'man 7 sched'
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      94cc5778
  13. 12 2月, 2015 1 次提交
  14. 11 2月, 2015 1 次提交
    • J
      virfile: Adjust error path for virFileOpenForked · 92d9114e
      John Ferlan 提交于
      Rather than have a dummy waitpid loop and return of the failure status
      from recvfd, adjust the logic to save the recvfd error & fd and then
      in priority order:
      
      - if waitpid failed, use that errno value
      - waitpid succeeded, but if the child exited abnormally, report failure
      (use EACCES to report as return failure, since either EACCES or EPERM is
      what caused us to fall into the fork+setuid path)
      - waitpid succeeded, but if the child reported non-zero status, report
      failure (use the errno value that the child encoded into exit status)
      - waitpid succeeded, but if recvfd failed, report recvfd_errno
      - waitpid and recvfd succeeded, use the fd
      
      NOTE: Original logic to retry the open and force owner mode was
      "documented" as only being attempted if we had already tried opening
      with the fork+setuid, but checked flags vs. VIR_FILE_OPEN_NOFORK which
      is counter to how we would get to that point. So that code was removed.
      92d9114e
  15. 06 2月, 2015 1 次提交
  16. 04 2月, 2015 1 次提交
  17. 03 2月, 2015 4 次提交
    • P
      virutil: fix MinGW build · 47dd6c43
      Pavel Hrdina 提交于
      Commit b38da584 introduced two new functions to get a page size but it
      won't work on Windows. We should take care of this.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      47dd6c43
    • P
      virnetdev: fix some issues found by coverity and mingw builds · 8bda9035
      Pavel Hrdina 提交于
      Commit e562a61a introduced new function to get/set interface state but
      there was misuse of ATTRIBUTE_NONNULL on non-pointer attributes and also
      we need to wrap that functions by #ifdef to not break mingw build.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      8bda9035
    • D
      Make tests independant of system page size · b38da584
      Daniel P. Berrange 提交于
      Some code paths have special logic depending on the page size
      reported by sysconf, which in turn affects the test results.
      We must mock this so tests always have a consistent page size.
      b38da584
    • L
      util: make virNetDev(Get|Set)IFFlags() static · df2cc650
      Laine Stump 提交于
      e562a61a added these two new helper functions and only used them
      within virnetdev.c, but declared them in the .h file. If some
      currently unsupported interface flags need to be accessed in the
      future, it will make more sense to write the appropriate higher level
      function rather than require us to artificially define IFF_* on some
      mythical platform that doesn't have SIOC[SG]IFFLAGS (and therefore
      doesn't have IFF_*) just so we can call virNetDevSetIFFFlags() to
      return an error.
      
      To help someone in not going down the wrong road, this patch makes the
      two helper functions static, hopefully making it less likely that
      someone will want to use them outside of virnetdev.c.
      df2cc650
  18. 31 1月, 2015 4 次提交
  19. 30 1月, 2015 2 次提交
  20. 29 1月, 2015 2 次提交