1. 11 12月, 2015 1 次提交
    • D
      log: include hostname in initial log message · 1ce92960
      Daniel P. Berrange 提交于
      On the very first log message we send to any output, we include
      the libvirt version number and package string. In some bug reports
      we have been given libvirtd.log files that came from a different
      host than the corresponding /var/log/libvirt/qemu log files. So
      extend the initial log message to include the hostname too.
      
      eg on first log message we would now see:
      
       $ libvirtd
       2015-12-04 17:35:36.610+0000: 20917: info : libvirt version: 1.3.0
       2015-12-04 17:35:36.610+0000: 20917: info : hostname: dhcp-1-180.lcy.redhat.com
       2015-12-04 17:35:36.610+0000: 20917: error : qemuMonitorIO:687 : internal error: End of file from monitor
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1ce92960
  2. 05 12月, 2015 1 次提交
  3. 02 12月, 2015 1 次提交
    • I
      network: selectively disable -Wcast-align in virNetDevParseDadStatus · af2954ae
      Ian Campbell 提交于
      Commit 0f7436ca "network: wait for DAD to finish for bridge IPv6 addresses"
      results in:
      
       CC     util/libvirt_util_la-virnetdevmacvlan.lo
      util/virnetdev.c: In function 'virNetDevParseDadStatus':
      util/virnetdev.c:1319:188: error: cast increases required alignment of target type [-Werror=cast-align]
      util/virnetdev.c:1332:41: error: cast increases required alignment of target type [-Werror=cast-align]
      util/virnetdev.c:1334:92: error: cast increases required alignment of target type [-Werror=cast-align]
      cc1: all warnings being treated as errors
      
      on at least ARM platforms.
      
      The three macros involved (NLMSG_NEXT, IFA_RTA and RTA_NEXT) all appear to
      correctly take care of alignment, therefore suppress Wcast-align around their
      uses.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Cc: Maxim Perevedentsev <mperevedentsev@virtuozzo.com>
      Cc: Laine Stump <laine@laine.org>
      Cc: Dario Faggioli <dario.faggioli@citrix.com>
      Cc: Jim Fehlig <jfehlig@suse.com>
      af2954ae
  4. 30 11月, 2015 5 次提交
  5. 27 11月, 2015 1 次提交
  6. 26 11月, 2015 3 次提交
  7. 25 11月, 2015 1 次提交
    • L
      nodedev: report maxCount for virtual_functions capability · f391889f
      Laine Stump 提交于
      A PCI device may have the capability to setup virtual functions (VFs)
      but have them currently all disabled. Prior to this patch, if that was
      the case the the node device XML for the device wouldn't report any
      virtual_functions capability.
      
      With this patch, if a file called "sriov_totalvfs" is found in the
      device's sysfs directory, its contents will be interpreted as a
      decimal number, and that value will be reported as "maxCount" in a
      capability element of the device's XML, e.g.:
      
         <capability type='virtual_functions' maxCount='7'/>
      
      This will be reported regardless of whether or not any VFs are
      currently enabled for the device.
      
      NB: sriov_numvfs (the number of VFs currently active) is also
      available in sysfs, but that value is implied by the number of items
      in the list that is inside the capability element, so there is no
      reason to explicitly provide it as an attribute.
      
      sriov_totalvfs and sriov_numvfs are available in kernels at least as far
      back as the 2.6.32 that is in RHEL6.7, but in the case that they
      simply aren't there, libvirt will behave as it did prior to this patch
      - no maxCount will be displayed, and the virtual_functions capability
      will be absent from the device's XML when 0 VFs are enabled.
      f391889f
  8. 24 11月, 2015 1 次提交
  9. 20 11月, 2015 1 次提交
  10. 19 11月, 2015 1 次提交
  11. 18 11月, 2015 2 次提交
  12. 16 11月, 2015 1 次提交
  13. 07 11月, 2015 2 次提交
    • J
      virnetdev: Use virNetDevSetupControl in virNetDevSendEthtoolIoctl · edc88e20
      John Ferlan 提交于
      Use virNetDevSetupControl instead of open coding using socket(AF_LOCAL...)
      and clearing virIfreq.
      
      By using virNetDevSetupControl, the socket is then opened using
      AF_PACKET which requires being privileged (effectively root) in
      order to complete successfully.  Since that's now a requirement,
      then the ioctl(SIOCETHTOOL) should not fail with EPERM, thus it
      is removed from the filtered listed of failure codes.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      edc88e20
    • J
      virnetdev: Check for root in virNetDevGetFeatures · d0a3a1ff
      John Ferlan 提交于
      Since the SIOCETHTOOL ioctl only works for privileged daemons, if called
      when not root, then virNetDevGetFeatures will VIR_DEBUG a message and
      return 0 as if the functions were not available for the architecture.
      This effectively returns an empty bitmap indicating no features available.
      
      Introduced by commit id 'c9027d8f'
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      d0a3a1ff
  14. 06 11月, 2015 3 次提交
    • J
      virnetdev: Fix function comments for virNetDevGetFeatures · 9efab5da
      John Ferlan 提交于
      In commit id 'c9027d8f' when updating the posted patch to generate
      a bitmap instead of an array of named feature bits, adjustment of
      the args was missed
      9efab5da
    • J
      virnetdev: Document reasons for ignoring some SIOCETHTOOL errno values · 301bd801
      John Ferlan 提交于
      Recently reverted commit id '6f2a0198' showed a need to add extra
      comments when dealing with filtering of potential "non-issues".
      
      Scanning through upstream patch postings indicates early on the
      reasons for the filtering of specific ioctl failures were provided;
      however, when converted from causing an error to VIR_DEBUG's the
      reasons were missing. A future read/change of the code incorrectly
      assumed they could or should be removed.
      301bd801
    • D
      Revert "utils: Remove the logging of errors from virNetDevSendEthtoolIoctl" · a3f63b85
      Daniel P. Berrange 提交于
      This reverts commit 6f2a0198.
      
      This commit removed error reporting from virNetDevSendEthtoolIoctl
      pushing responsibility onto the callers. This is wrong, however,
      since virNetDevSendEthtoolIoctl calls virNetDevSetupControl
      which can still report errors. So as a result virNetDevSendEthtoolIoctl
      may or may not report errors depending on which bit of it fails, and as
      a result callers now overwrite some errors.
      
      It also introduced a regression causing unprivileged libvirtd to
      spew error messages to the console due to inability to query the
      NIC features, an error which was previously ignored.
      
      virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
      virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted
      virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
      virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted
      virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
      virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted
      virNetDevSetupControlFull:148 : Cannot open network interface control socket: Operation not permitted
      virNetDevFeatureAvailable:3062 : Cannot get device wlp3s0 flags: Operation not permitted
      
      Looking back at the original posting I see no explanation of why
      thsi refactoring was needed, so reverting the clearly broken
      error reporting logic looks like the best option.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a3f63b85
  15. 05 11月, 2015 2 次提交
  16. 04 11月, 2015 1 次提交
  17. 30 10月, 2015 2 次提交
    • L
      util: set max wait for IPv6 DAD to 20 seconds · ac339206
      Laine Stump 提交于
      This was originally set to 5 seconds, but times of 5.5 to 7 seconds
      were experienced. Since it's an arbitrary number intended to prevent
      an infinite hang, having it a bit too high won't hurt anything, and 20
      seconds looks to be adequate (i.e. I think/hope we don't need to make
      it tunable in libvirtd.conf)
      ac339206
    • L
      util: set error if DAD is not finished · d41a64a1
      Luyao Huang 提交于
      If DAD not finished in 5 seconds, user will get an
      unknown error like this:
      
       # virsh net-start ipv6
       error: Failed to start network ipv6
       error: An error occurred, but the cause is unknown
      
      Call virReportError to set an error.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      d41a64a1
  18. 29 10月, 2015 3 次提交
    • R
      Fix virNetDevWaitDadFinish stub · 2589ca30
      Roman Bogorodskiy 提交于
      Build on non-Linux fails because the virNetDevWaitDadFinish() stub
      has unused parameters. Fix by adding appropriate ATTRIBUTE_UNUSED
      for these parameters.
      
      Pushing under build-breaker rule.
      2589ca30
    • M
      network: wait for DAD to finish for bridge IPv6 addresses · 0f7436ca
      Maxim Perevedentsev 提交于
      commit db488c79 assumed that dnsmasq would complete IPv6 DAD before
      daemonizing, but in reality it doesn't wait, which creates problems
      when libvirt's bridge driver sets the matching "dummy tap device" to
      IFF_DOWN prior to DAD completing.
      
      This patch waits for DAD completion by periodically polling the kernel
      using netlink to check whether there are any IPv6 addresses assigned
      to bridge which have a 'tentative' state (if there are any in this
      state, then DAD hasn't yet finished). After DAD is finished, execution
      continues. To avoid an endless hang in case something was wrong with
      the kernel's DAD, we wait a maximum of 5 seconds.
      0f7436ca
    • M
      netlink: add support for multi-part netlink messages. · 131e7245
      Maxim Perevedentsev 提交于
      Such messages do not have NLMSG_ERROR or NLMSG_DONE type
      but they are valid responses. We test 'multi-partness'
      by looking for NLM_F_MULTI flag.
      131e7245
  19. 28 10月, 2015 1 次提交
  20. 26 10月, 2015 1 次提交
  21. 22 10月, 2015 3 次提交
    • L
      util: Produce friendlier error message to user · 4f9e61f6
      Luyao Huang 提交于
      Commit id '1c24cfe9' added error messages for virNumaSetPagePoolSize;
      however, virNumaGetHugePageInfo also uses virNumaGetHugePageInfoPath
      in order to build the path, but it never checked upon return if
      the built path exists which could lead to an error message as follows:
      
      $ virsh freepages 0 1
      error: Failed to open file
          '/sys/devices/system/node/node0/hugepages/hugepages-1kB/free_hugepages':
          No such file or directory
      
      Rather than add the same message for the other two callers, adjust
      the virNumaGetHugePageInfoPath in order not only build the path, but
      also check if the built path exists.  If the path does not exist,
      then generate the error message and return failure.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      4f9e61f6
    • L
      util: Adjust error paths for virNumaSetPagePoolSize · e802d7ef
      Luyao Huang 提交于
      Commit id '1c24cfe9' added new checks and error messaes for failure
      scenarios. Let's adjust those error messages to after the call to
      virNumaGetHugePageInfoPath in order to provide a more specific error
      message depending on node and page_size
      
      After this patch:
       # virsh allocpages --pagesize 2047 --pagecount 1 --cellno 0
       error: operation failed: page size 2047 is not available on node 0
      
       # virsh allocpages --pagesize 2047 --pagecount 1
       error: operation failed: page size 2047 is not available
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      e802d7ef
    • L
      util: split the virNumaGetHugePageInfoPath into separate function · deb8c66d
      Luyao Huang 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1265114
      
      Refactor helper virNumaGetHugePageInfoPath to handle returning a directory
      path when passed a page_size of 0 and suffix == NULL into a new helper
      virNumaGetHugePageInfoDir which will only be called when a directory
      path is expected to be returned. This solves the issue where the helper
      was called with page_size == 0 expecting a file path in return, but
      instead got a directory path and failed in virFileReadAll with:
      
          error : virFileReadAll:1358 : Failed to read file
                      '/sys/devices/system/node/node0/hugepages/': Is a directory
      
      Since virNumaGetPages API expects to return a directory by passing
      page_size == 0 and suffix == NULL, it will now call the new helper.
      Callers to virNumaGetHugePageInfoPath expect to return a file path
      which could then be used in the call to virFileReadAll.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      deb8c66d
  22. 21 10月, 2015 1 次提交
  23. 16 10月, 2015 1 次提交
  24. 14 10月, 2015 1 次提交
    • J
      storage: On error rmdir created directory in virDirCreate[NoFork] · 21eb8972
      John Ferlan 提交于
      After a successful creation of a directory, if some other call results
      in returning a failure, let's remove the directory we created to
      prevent another round trip or confusion in the caller. In particular, this
      function can be called during a storage backend buildVol, so in order
      to ensure that caller doesn't need to distinguish between failed create
      or some other failure after create, just remove the directory we created.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      21eb8972