1. 13 3月, 2014 7 次提交
  2. 12 3月, 2014 1 次提交
  3. 11 3月, 2014 2 次提交
  4. 04 3月, 2014 3 次提交
    • C
      6b4c0a63
    • E
      util: make it easier to grab only regular command exit · b9dd878f
      Eric Blake 提交于
      Auditing all callers of virCommandRun and virCommandWait that
      passed a non-NULL pointer for exit status turned up some
      interesting observations.  Many callers were merely passing
      a pointer to avoid the overall command dying, but without
      caring what the exit status was - but these callers would
      be better off treating a child death by signal as an abnormal
      exit.  Other callers were actually acting on the status, but
      not all of them remembered to filter by WIFEXITED and convert
      with WEXITSTATUS; depending on the platform, this can result
      in a status being reported as 256 times too big.  And among
      those that correctly parse the output, it gets rather verbose.
      Finally, there were the callers that explicitly checked that
      the status was 0, and gave their own message, but with fewer
      details than what virCommand gives for free.
      
      So the best idea is to move the complexity out of callers and
      into virCommand - by default, we return the actual exit status
      already cleaned through WEXITSTATUS and treat signals as a
      failed command; but the few callers that care can ask for raw
      status and act on it themselves.
      
      * src/util/vircommand.h (virCommandRawStatus): New prototype.
      * src/libvirt_private.syms (util/command.h): Export it.
      * docs/internals/command.html.in: Document it.
      * src/util/vircommand.c (virCommandRawStatus): New function.
      (virCommandWait): Adjust semantics.
      * tests/commandtest.c (test1): Test it.
      * daemon/remote.c (remoteDispatchAuthPolkit): Adjust callers.
      * src/access/viraccessdriverpolkit.c (virAccessDriverPolkitCheck):
      Likewise.
      * src/fdstream.c (virFDStreamCloseInt): Likewise.
      * src/lxc/lxc_process.c (virLXCProcessStart): Likewise.
      * src/qemu/qemu_command.c (qemuCreateInBridgePortWithHelper):
      Likewise.
      * src/xen/xen_driver.c (xenUnifiedXendProbe): Simplify.
      * tests/reconnect.c (mymain): Likewise.
      * tests/statstest.c (mymain): Likewise.
      * src/bhyve/bhyve_process.c (virBhyveProcessStart)
      (virBhyveProcessStop): Don't overwrite virCommand error.
      * src/libvirt.c (virConnectAuthGainPolkit): Likewise.
      * src/openvz/openvz_driver.c (openvzDomainGetBarrierLimit)
      (openvzDomainSetBarrierLimit): Likewise.
      * src/util/virebtables.c (virEbTablesOnceInit): Likewise.
      * src/util/viriptables.c (virIpTablesOnceInit): Likewise.
      * src/util/virnetdevveth.c (virNetDevVethCreate): Fix debug
      message.
      * src/qemu/qemu_capabilities.c (virQEMUCapsInitQMP): Add comment.
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSINodeUpdate): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b9dd878f
    • E
      util: make it easier to reflect child exit status · 2b4f162e
      Eric Blake 提交于
      Thanks to namespaces, we have a couple of places in the code
      base that want to reflect a child exit status, including the
      ability to detect death by a signal, back to a grandparent.
      Best to make it a reusable function.
      
      * src/util/virprocess.h (virProcessExitWithStatus): New prototype.
      * src/libvirt_private.syms (util/virprocess.h): Export it.
      * src/util/virprocess.c (virProcessExitWithStatus): New function.
      * tests/commandtest.c (test23): Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2b4f162e
  5. 25 2月, 2014 1 次提交
  6. 24 2月, 2014 4 次提交
  7. 20 2月, 2014 4 次提交
  8. 19 2月, 2014 1 次提交
  9. 18 2月, 2014 4 次提交
  10. 14 2月, 2014 2 次提交
  11. 13 2月, 2014 1 次提交
    • C
      Improve virConf parse to handle LXC config format · 3daa1483
      Cédric Bosdonnat 提交于
      virConf now honours a VIR_CONF_FLAG_LXC_FORMAT flag to handle LXC
      configuration files. The differences are that property names can
      contain '.' character and values are all strings without any bounding
      quotes.
      
      Provide a new virConfWalk function calling a handler on all non-comment
      values. This function will be used by the LXC conversion code to loop
      over LXC configuration lines.
      3daa1483
  12. 07 2月, 2014 1 次提交
  13. 04 2月, 2014 1 次提交
    • J
      utils: Introduce functions for kernel module manipulation · 4a2179ea
      John Ferlan 提交于
      virKModConfig()        - Return a buffer containing kernel module configuration
      virKModLoad()          - Load a specific module into the kernel configuration
      virKModUnload()        - Unload a specific module from the kernel configuration
      virKModIsBlacklisted() - Determine whether a module is blacklisted within
                               the kernel configuration
      4a2179ea
  14. 31 1月, 2014 2 次提交
    • D
      Push nwfilter update locking up to top level · 6e5c79a1
      Daniel P. Berrange 提交于
      The NWFilter code has as a deadlock race condition between
      the virNWFilter{Define,Undefine} APIs and starting of guest
      VMs due to mis-matched lock ordering.
      
      In the virNWFilter{Define,Undefine} codepaths the lock ordering
      is
      
        1. nwfilter driver lock
        2. virt driver lock
        3. nwfilter update lock
        4. domain object lock
      
      In the VM guest startup paths the lock ordering is
      
        1. virt driver lock
        2. domain object lock
        3. nwfilter update lock
      
      As can be seen the domain object and nwfilter update locks are
      not acquired in a consistent order.
      
      The fix used is to push the nwfilter update lock upto the top
      level resulting in a lock ordering for virNWFilter{Define,Undefine}
      of
      
        1. nwfilter driver lock
        2. nwfilter update lock
        3. virt driver lock
        4. domain object lock
      
      and VM start using
      
        1. nwfilter update lock
        2. virt driver lock
        3. domain object lock
      
      This has the effect of serializing VM startup once again, even if
      no nwfilters are applied to the guest. There is also the possibility
      of deadlock due to a call graph loop via virNWFilterInstantiate
      and virNWFilterInstantiateFilterLate.
      
      These two problems mean the lock must be turned into a read/write
      lock instead of a plain mutex at the same time. The lock is used to
      serialize changes to the "driver->nwfilters" hash, so the write lock
      only needs to be held by the define/undefine methods. All other
      methods can rely on a read lock which allows good concurrency.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      6e5c79a1
    • D
      Add a read/write lock implementation · c065984b
      Daniel P. Berrange 提交于
      Add virRWLock backed up by a POSIX rwlock primitive
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      c065984b
  15. 30 1月, 2014 3 次提交
    • O
      qemu: Don't fail if the SCSI host device is shareable between domains · fd243fc4
      Osier Yang 提交于
      It doesn't make sense to fail if the SCSI host device is specified
      as "shareable" explicitly between domains (NB, it works if and only
      if the device is specified as "shareable" for *all* domains,
      otherwise it fails).
      
      To fix the problem, this patch introduces an array for virSCSIDevice
      struct, which records all the names of domain which are using the
      device (note that the recorded domains must specify the device as
      shareable).  And the change on the data struct brings on many
      subsequent changes in the code.
      
      Prior to this patch, the "shareable" tag didn't work as expected,
      it actually work like "non-shareable".  So this patch also added notes
      in formatdomain.html to declare the fact.
      
      * src/util/virscsi.h:
        - Remove virSCSIDeviceGetUsedBy
        - Change definition of virSCSIDeviceGetUsedBy and virSCSIDeviceListDel
        - Add virSCSIDeviceIsAvailable
      
      * src/util/virscsi.c:
        - struct virSCSIDevice: Change "used_by" to be an array; Add
          "n_used_by" as the array count
        - virSCSIDeviceGetUsedBy: Removed
        - virSCSIDeviceFree: frees the "used_by" array
        - virSCSIDeviceSetUsedBy: Copy the domain name to avoid potential
          memory corruption
        - virSCSIDeviceIsAvailable: New
        - virSCSIDeviceListDel: Change the logic, for device which is already
          in the list, just remove the corresponding entry in "used_by". And
          since it's only used in one place, we can safely removing the code
          to find out the dev in the list first.
        - Copyright updating
      
      * src/libvirt_private.sys:
        - virSCSIDeviceGetUsedBy: Remove
        - virSCSIDeviceIsAvailable: New
      
      * src/qemu/qemu_hostdev.c:
        - qemuUpdateActiveScsiHostdevs: Check if the device existing before
          adding it to the list;
        - qemuPrepareHostdevSCSIDevices: Error out if the not all domains
          use the device as "shareable"; Also don't try to add the device
          to the activeScsiHostdevs list if it already there; And make
          more sensible error w.r.t the current "shareable" value in
          driver->activeScsiHostdevs.
        - qemuDomainReAttachHostScsiDevices: Change the logic according
          to the changes on helpers.
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      fd243fc4
    • M
      Revert "networkAllocateActualDevice: Set QoS for bridgeless networks too" · 122cd169
      Michal Privoznik 提交于
      This reverts commit 2996e6be
      and some parts of 2636dc8c.
      
      The former one tried to implement QoS setting on bridgeless networks.
      However, as discussed upstream [1], the patch is far away from being
      useful in even a single case. The whole idea of network QoS is to have
      aggregated limits over several interfaces. This patch is doing
      completely the opposite when merging two QoS settings (from the network
      and the domain interface) into one which is then set at the domain
      interface itself, not the network.
      
      The latter one is the test for the previous one. Now none of them makes
      sense.
      
      1: https://www.redhat.com/archives/libvir-list/2014-January/msg01441.html
      
      Conflicts:
      	tests/virnetdevbandwidthtest.c: New test has been introduced since
          then.
      122cd169
    • M
      virCommand: Introduce virCommandSetDryRun · 550a2cef
      Michal Privoznik 提交于
      There are some units within libvirt that utilize virCommand API to run
      some commands and deserve own unit testing. These units are, however,
      not desired to be rewritten to dig virCommand API usage out. As a great
      example virNetDevBandwidth could be used. The problem with the bandwidth
      unit is: it uses virCommand API heavily. Therefore we need a mechanism
      to not really run a command, but rather see its string representation
      after which we can decide if the unit construct the correct sequence of
      commands or not.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      550a2cef
  16. 27 1月, 2014 1 次提交
    • M
      networkAllocateActualDevice: Set QoS for bridgeless networks too · 2996e6be
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1055484
      
      Currently, libvirt's XML schema of network allows QoS to be defined for
      every network even though it has no bridge. For instance:
      
      <network>
          <name>vdsm-no-bridge</name>
          <forward mode='passthrough'>
            <interface dev='em1.10'/>
          </forward>
          <bandwidth>
              <inbound average='1000' peak='5000' burst='1024'/>
              <outbound average='1000' burst='1024'/>
          </bandwidth>
      </network>
      
      The bandwidth limitations can be, however, applied even on such
      networks. In fact, they are going to be applied on the interface that
      will be connected to the network on a domain startup. This approach,
      however, has one limitation. With bridged networks, there are two points
      where QoS can be set: bridge and domain interface. The lower limit of
      the two is enforced then. For instance, if the interface has 10Mbps
      average, but the network only 1Mbps, there's no way for interface to
      transmit packets faster than the 1Mbps limit. With two points this is
      enforced by kernel.  With only one point, we must combine both QoS
      settings into one which is set afterwards. Look at
      virNetDevBandwidthMinimal() and you'll understand immediately what I
      mean.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2996e6be
  17. 23 1月, 2014 1 次提交
    • O
      util: Add "shareable" field for virSCSIDevice struct · 2b66504d
      Osier Yang 提交于
      Unlike the host devices of other types, SCSI host device XML supports
      "shareable" tag. This patch introduces it for the virSCSIDevice struct
      for a later patch use (to detect if the SCSI device is shareable when
      preparing the SCSI host device in QEMU driver).
      2b66504d
  18. 21 1月, 2014 1 次提交
    • F
      spice: expose the QEMU disable file transfer option · 08d07e5f
      Francesco Romani 提交于
      spice-server offers an API to disable file transfer messages
      on the agent channel between the client and the guest.
      This is supported in qemu through the disable-agent-file-xfer option.
      
      This patch exposes this option to libvirt.
      Adds a new element 'filetransfer', with one property,
      'enable', which accepts a boolean.
      Default is enabled, for backward compatibility.
      
      Depends on the capability exported in the first patch of the series.
      Signed-off-by: NFrancesco Romani <fromani@redhat.com>
      08d07e5f