1. 10 11月, 2015 3 次提交
  2. 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
  3. 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
  4. 05 11月, 2015 4 次提交
  5. 04 11月, 2015 12 次提交
    • J
      storage: On 'buildVol' failure don't delete the volume · 4cd7d220
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1233003
      
      Commit id 'fdda3760' only managed a symptom where it was possible to
      create a file in a pool without libvirt's knowledge, so it was reverted.
      
      The real fix is to have all the createVol API's which actually create
      a volume (disk, logical, zfs) and the buildVol API's which handle the
      real creation of some volume file (fs, rbd, sheepdog) manage deleting
      any volume which they create when there is some sort of error in
      processing the volume.
      
      This way the onus isn't left up to the storage_driver to determine whether
      the buildVol failure was due to some failure as a result of adjustments
      made to the volume after creation such as getting sizes, changing ownership,
      changing volume protections, etc. or simple a failure in creation.
      
      Without needing to consider that the volume has to be removed, the
      buildVol failure path only needs to remove the volume from the pool.
      This way if a creation failed due to duplicate name, libvirt wouldn't
      remove a volume that it didn't create in the pool target.
      4cd7d220
    • J
      Revert "storage: Prior to creating a volume, refresh the pool" · 0a6e709c
      John Ferlan 提交于
      This reverts commit fdda3760.
      
      This commit only manages a symptom of finding a buildRet failure
      where a volume was not listed in the pool, but someone created the
      volume outside of libvirt in the pool being managed by libvirt.
      0a6e709c
    • J
      storage: Pull volume removal from pool in storageVolDeleteInternal · a1703557
      John Ferlan 提交于
      Create a helper function to remove volume from the pool.
      a1703557
    • J
      storage: Cleanup failures in virStorageBackendCreateRaw · 2265e7dd
      John Ferlan 提交于
      After successfully returning from virFileOpenAs, if subsequent calls fail,
      then we need to remove the file since our caller expects that failures after
      creation will remove the created file.
      2265e7dd
    • J
      storage: Cleanup failures virStorageBackendCreateExecCommand · 9345c2bf
      John Ferlan 提交于
      After a successful qemu-img/qcow-create of the backing file, if we
      fail to stat the file, change it owner/group, or mode, then the
      cleanup path should remove the file.
      9345c2bf
    • J
      storage: Fix setting mode in virStorageBackendCreateExecCommand · 77346f27
      John Ferlan 提交于
      Currently the code does not handle the NFS root squash environment
      properly since if the file gets created, then the subsequent chmod
      will fail in a root squash environment where we're creating a file
      in the pool with qemu tools, such as seen via:
      
         $ virsh vol-create-from $pool $file.xml file.img --inputpool $pool
      
      assuming $file.xml is creating a file of "<format type='qcow2'"> from
      an existing file.img in the pool of "<format type='raw'>".
      
      This patch will utilize the virCommandSetUmask when creating the file
      in the NETFS pool. The virCommandSetUmask API was added in commit id
      '0e1a1a8c', which was after the original code was developed in commit
      id 'e1f27784' to attempt to handle the root squash environment.
      
      Also, rather than blindly attempting to chmod, check to see if the
      st_mode bits from the stat match what we're trying to set and only
      make the chmod if they don't.
      
      Also, a slight adjustment to the fallback algorithm to move the
      virCommandSetUID/virCommandSetGID inside the if (!filecreated) since
      they're only useful if we need to attempt to create the file again.
      77346f27
    • J
      Remove new lines from log messages · e4ee0436
      Jiri Denemark 提交于
      VIR_DEBUG and VIR_WARN will automatically add a new line to the message,
      having "\n" at the end or at the beginning of the message results in
      empty lines.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      e4ee0436
    • J
      qemu: Fix memory leak in qemuProcessStart · 630341a2
      Jiri Denemark 提交于
      nodeset should be freed in both success and failure paths.
      
      While tmppath is freed immediately after it's consumed, moving it from
      error to cleanup label is a bit more consistent and robust.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      630341a2
    • J
      qemu: Introduce cleanup label in qemuProcessStart · d65ab51d
      Jiri Denemark 提交于
      Remove code duplication by moving common cleanup code in a dedicated
      label.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      d65ab51d
    • J
      qemu: Rename ret variable in qemuProcessStart · 93df3a97
      Jiri Denemark 提交于
      Generally, we use "ret" variable for storing the value we are going to
      return at the and of a function, but this is not the case in
      qemuProcessStart. Let's rename "ret" as "rv".
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      93df3a97
    • J
      qemu: Rename cleanup label in qemuProcessStart · 7404c405
      Jiri Denemark 提交于
      Current "cleanup" label is only used in error path, thus it should
      rather be called "error".
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      7404c405
    • J
      qemu: Use correct type when calling qemuPrepareNVRAM · b33c33b7
      Jiri Denemark 提交于
      qemuProcessStart was passing char * migrateFrom as the third argument to
      qemuPrepareNVRAM. We should explicitly convert the pointer to bool which
      is what the function expects.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      b33c33b7
  6. 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
  7. 29 10月, 2015 4 次提交
    • 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
    • L
      qemu: Use live autoNodeset when numatune placement is auto · 4eac5523
      Luyao Huang 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1270715
      
      Commit id '9deb96f9' removed the code to fetch the nodeset from the
      CpusetMems cgroup for a running vm in favor of using the return from
      virDomainNumatuneFormatNodeset introduced by commit id '43b67f2e'.
      However, that API will return the value of the passed 'auto_nodeset'
      when placement is VIR_DOMAIN_NUMATUNE_PLACEMENT_AUTO, which happens
      to be NULL.
      
      Since commit id 'c74d58ad' started using priv->autoNodeset in order
      to manage the auto placement value during qemuProcessStart, it should
      be passed along in order to return the correct value if the domain
      requests the auto placement.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      4eac5523
  8. 28 10月, 2015 2 次提交
  9. 27 10月, 2015 6 次提交
  10. 26 10月, 2015 2 次提交