1. 16 5月, 2016 1 次提交
  2. 13 5月, 2016 1 次提交
  3. 12 5月, 2016 1 次提交
    • E
      util: Fix virGetLastErrorMessage to return proper error when 'err' is NULL · e711a391
      Erik Skultety 提交于
      Both virGetLastError and virGetLastErrorMessage call virLastErrorObject method
      that returns a thread-local error object. However, if a direct call to malloc
      or pthread_setspecific (probably also due to malloc, since it sets ENOMEM)
      fail, virLastErrorObject returns NULL which, although incorrectly interpreted
      by virGetLastError as no error, still requires the caller to check for NULL
      pointer. This isn't the case with virGetLastErrorMessage that also treated it
      incorrectly as no error, but returned the literal "no error".
      This patch tweaks the checks in the virGetLastErrorMessage function, so that
      if virLastErrorObject failed, it returned "unknown error" which is equivalent
      to the current approach with virGetLastError and if it returned NULL,
      "unknown error" was set.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      e711a391
  4. 11 5月, 2016 3 次提交
    • J
      storage: Fix regression cloning volume into a logical pool · 2c52ec43
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1318993
      
      Commit id 'dd519a29' caused a regression cloning a volume into a
      logical pool by removing just the 'allocation' adjustment during
      storageVolCreateXMLFrom. Combined with the change to not require the
      new volume input XML to have a capacity listed (commit id 'e3f1d2a8')
      left the possibility that a zero allocation value (e.g., not provided)
      would create a thin/sparse logical volume. When a thin lv becomes fully
      populated, then LVM sets the partition 'inactive' and the subsequent
      fdatasync() fails.
      
      Add a new 'has_allocation' flag to be set at XML parse time to indicate
      that allocation was provided. This is done so that if it's not provided
      the create-from code uses the capacity value since we document that if
      omitted, the volume will be fully allocated at time of creation.
      
      For a logical backend, that creation time is 'createVol', while for a
      file backend, creation doesn't set the size, but the 'createRaw' called
      during buildVolFrom will decide whether the file is sparse or not based
      on the provided capacity and allocation value.
      
      For volume clones that provide different allocation and capacity values
      to allow for sparse files, there is no change.
      2c52ec43
    • E
      headers: Remove unnecessary keyword extern from function declaration · 898c0bbe
      Erik Skultety 提交于
      Usage of this keyword in front of function declaration that is exported via a
      header file is unnecessary, since internally, this has been the default for most
      compilers for quite some time.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      898c0bbe
    • L
      util: set vlan tag for macvtap passthrough mode on SRIOV VFs · 75db9997
      Laine Stump 提交于
      SRIOV VFs used in macvtap passthrough mode can take advantage of the
      SRIOV card's transparent vlan tagging. All the code was there to set
      the vlan tag, and it has been used for SRIOV VFs used for hostdev
      interfaces for several years, but for some reason, the vlan tag for
      macvtap passthrough devices was stubbed out with a -1.
      
      This patch moves a bit of common validation down to a lower level
      (virNetDevReplaceNetConfig()) so it is shared by hostdev and macvtap
      modes, and updates the macvtap caller to actually send the vlan config
      instead of -1.
      75db9997
  5. 09 5月, 2016 2 次提交
  6. 06 5月, 2016 1 次提交
    • M
      virCgroupValidateMachineGroup: Reflect change in CGroup struct naming · fb377701
      Michal Privoznik 提交于
      Fron c3bd0019 on instead of creating the following path for
      cgroups:
      
        /sys/fs/cgroupX/$name.libvirt-$driver
      
      we generate rather more verbose one:
      
        /sys/fs/cgroupX/$driver-$id-$name.libvirt-$driver
      
      where $name is optional and included iff contains allowed chars.
      See original commit for more reasoning. Now, problem with the
      original commit is that we are unable to start any LXC domain
      after it. Because when starting LXC container, the CGroup layout
      is created by our lxc_controller process and then detected and
      validated by libvirtd. The validation is done by trying to match
      detected layout against all the possible patterns for cgroup
      paths that we've ever had. And the commit in question forgot to
      update this part of the code.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      fb377701
  7. 05 5月, 2016 1 次提交
  8. 03 5月, 2016 3 次提交
  9. 02 5月, 2016 3 次提交
  10. 22 4月, 2016 1 次提交
    • C
      virconf: Handle conf file without ending newline · 3cc2a9e0
      Cole Robinson 提交于
      $ echo -n 'log_level=1' > ~/.config/libvirt/libvirtd.conf
      $ libvirtd --timeout=10
      2014-10-10 10:30:56.394+0000: 6626: info : libvirt version: 1.1.3.6, package: 1.fc20 (Fedora Project, 2014-09-08-17:50:42, buildvm-05.phx2.fedoraproject.org)
      2014-10-10 10:30:56.394+0000: 6626: error : main:1261 : Can't load config file: configuration file syntax error: /home/rjones/.config/libvirt/libvirtd.conf:1: expecting a value: /home/rjones/.config/libvirt/libvirtd.conf
      
      Rather than try to fix this in the depths of the parser, just catch
      the case when a config file doesn't end in a newline, and manually
      append a newline to the content before parsing
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1151409
      3cc2a9e0
  11. 20 4月, 2016 2 次提交
    • C
      storage: remove support for /usr/bin/kvm-img · 487d211d
      Cole Robinson 提交于
      This an ubuntu/debian packaging convention. At one point it may have
      been an actually different binary, but at least as of ubuntu precise
      (the oldest supported ubuntu distro, released april 2012) kvm-img is
      just a symlink to qemu-img for back compat.
      
      I think it's safe to drop support for it
      487d211d
    • A
      qemu: Probe GIC capabilities · 12209ba5
      Andrea Bolognani 提交于
      QEMU introduced the query-gic-capabilities QMP command
      with commit 4468d4e0f383: use the command, if available,
      to probe available GIC capabilities.
      
      The information obtained is stored in a virQEMUCaps
      instance, and will be later used to fill in a
      virDomainCaps instance.
      12209ba5
  12. 19 4月, 2016 1 次提交
  13. 18 4月, 2016 6 次提交
    • E
      admin: Introduce virAdmServerSetThreadPoolParameters · 93ab4da5
      Erik Skultety 提交于
      Since threadpool increments the current number of threads according to current
      load, i.e. how many jobs are waiting in the queue. The count however, is
      constrained by max and min limits of workers. The logic of this new API works
      like this:
          1) setting the minimum
              a) When the limit is increased, depending on the current number of
                 threads, new threads are possibly spawned if the current number of
                 threads is less than the new minimum limit
              b) Decreasing the minimum limit has no possible effect on the current
                 number of threads
          2) setting the maximum
              a) Icreasing the maximum limit has no immediate effect on the current
                 number of threads, it only allows the threadpool to spawn more
                 threads when new jobs, that would otherwise end up queued, arrive.
              b) Decreasing the maximum limit may affect the current number of
                 threads, if the current number of threads is less than the new
                 maximum limit. Since there may be some ongoing time-consuming jobs
                 that would effectively block this API from killing any threads.
                 Therefore, this API is asynchronous with best-effort execution,
                 i.e. the necessary number of workers will be terminated once they
                 finish their previous job, unless other workers had already
                 terminated, decreasing the limit to the requested value.
          3) setting priority workers
              - both increase and decrease in count of these workers have an
                immediate impact on the current number of workers, new ones will be
                spawned or some of them get terminated respectively.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      93ab4da5
    • E
      util: Add more getters to threadpool parameters · c516e7d3
      Erik Skultety 提交于
      In order for the client to see all thread counts and limits, current total
      and free worker count getters need to be introduced. Client might also be
      interested in the job queue length, so provide a getter for that too. As with
      the other getters, preparing for the admin interface, mutual exclusion is used
      within all getters.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      c516e7d3
    • E
      util: Use a mutex when retrieving threadpool data · e981607e
      Erik Skultety 提交于
      So far, the values the affected getters retrieve are static, i.e. there's no
      way of changing them during runtime. But admin interface will later enable
      not only getting but changing them as well. So to prevent phenomenons like
      torn reads or concurrent reads and writes of unaligned values, use mutual
      exclusion when getting these values (writes do, understandably, use them
      already).
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      e981607e
    • E
      util: Report system error when virThreadCreateFull fails · 79685175
      Erik Skultety 提交于
      Otherwise 'Unknown' error will be returned to client.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      79685175
    • E
      util: Refactor thread creation by introducing virThreadPoolExpand · 396f8051
      Erik Skultety 提交于
      When either creating a threadpool, or creating a new thread to accomplish a job
      that had been placed into the jobqueue, every time thread-specific data need to
      be allocated, threadpool needs to be (re)-allocated and thread count indicators
      updated. Make the code clearer to read by compressing these operations into a
      more complex one.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      396f8051
    • J
      Libvirt: virTypedParamsValidate: Fix detection of multiple parameters · 0e570a6a
      Jason J. Herne 提交于
      virTypedParamsValidate currently uses an index based check to find
      duplicate parameters. This check does not work. Consider the following
      simple example:
      
      We have only 2 keys
      A  (multiples allowed)
      B  (multiples NOT allowed)
      
      We are given the following list of parameters to check:
      A
      A
      B
      
      If you work through the validation loop you will see that our last iteration
      through the loop has i=2 and j=1. In this case, i > j and keys[j].value.i will
      indicate that multiples are not allowed. Both conditionals are satisfied so
      an incorrect error will be given: "parameter '%s' occurs multiple times"
      
      This patch replaces the index based check with code that remembers
      the name of the last parameter seen and only triggers the error case if
      the current parameter name equals the last one. This works because the
      list is sorted and duplicate parameters will be grouped together.
      
      In reality, we hit this bug while using selective block migration to migrate
      a guest with 5 disks. 5 was apparently just the right number to push i > j
      and hit this bug.
      
      virsh migrate --live guestname --copy-storage-all
                    --migrate-disks vdb,vdc,vdd,vde,vdf
                    qemu+ssh://dsthost/systemSigned-off-by: NJason J. Herne <jjherne@linux.vnet.ibm.com>
      Reviewed-by: NEric Farman <farman@linux.vnet.ibm.com>
      0e570a6a
  14. 15 4月, 2016 3 次提交
  15. 13 4月, 2016 2 次提交
  16. 12 4月, 2016 1 次提交
  17. 11 4月, 2016 1 次提交
  18. 08 4月, 2016 4 次提交
  19. 07 4月, 2016 1 次提交
    • J
      util: Introduce virRandomBytes · 6af73f53
      John Ferlan 提交于
      Using the existing virUUIDGenerateRandomBytes, move API to virrandom.c
      rename it to virRandomBytes and add it to libvirt_private.syms.
      
      This will be used as a fallback for generating a domain master key.
      6af73f53
  20. 01 4月, 2016 1 次提交
    • A
      Revert "hostdev: Use actual device when reattaching" · fbd4db79
      Andrea Bolognani 提交于
      This reverts commit ee4cfb56.
      
      Since we're still not persisting our bookkeeping lists across
      daemon restarts, we might have lost some information
      virPCIDeviceReattach() relies on, for example whether the
      device needs to be unbound from the stub driver.
      
      As a result, if the daemon has been restarted in the meantime,
      the device might end up remaining bound to the stub driver even
      after 'virsh nodedev-reattach' or similar has been called, with
      no way of giving it back to the host short of messing with
      sysfs behind libvirt's back.
      
      Revert back to the previous behavior of always trying to bind
      the device to the host driver, regardless of its status when it
      was detached, until persistent bookkeeping lists have been
      implemented.
      fbd4db79
  21. 31 3月, 2016 1 次提交