1. 10 3月, 2014 6 次提交
    • M
    • M
      conf: Utilize more of VIR_(APPEND|INSERT|DELETE)_ELEMENT · 2133441a
      Michal Privoznik 提交于
      This fixes a possible double free. In virNetworkAssignDef() if
      virBitmapNew() fails, then virNetworkObjFree(network) is called.
      However, with network->def pointing to actual @def. So if caller
      frees @def again, ...
      
      Moreover, this fixes one possible memory leak too. In
      virInterfaceAssignDef() if appending to the list of interfaces
      fails, we ought to call virInterfaceObjFree() instead of bare
      VIR_FREE().
      
      Although, in order to do that some array size variables needs
      to be turned into size_t rather than int.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2133441a
    • D
      Add a mutex to serialize updates to firewall · 925de19e
      Daniel P. Berrange 提交于
      The nwfilter conf update mutex previously serialized
      updates to the internal data structures for firewall
      rules, and updates to the firewall itself. The latter
      was recently turned into a read/write lock, and filter
      instantiation allowed to proceed in parallel. It was
      believed that this was ok, since each filter is created
      on a separate iptables/ebtables chain.
      
      It turns out that there is a subtle lock ordering problem
      on virNWFilterObjPtr instances. __virNWFilterInstantiateFilter
      will hold a lock on the virNWFilterObjPtr it is instantiating.
      This in turn invokes virNWFilterInstantiate which then invokes
      virNWFilterDetermineMissingVarsRec which then invokes
      virNWFilterObjFindByName. This iterates over every single
      virNWFilterObjPtr in the list, locking them and checking their
      name. So if 2 or more threads try to instantiate a filter in
      parallel, they'll all hold 1 lock at the top level in the
      __virNWFilterInstantiateFilter method which will cause the
      other thread to deadlock in virNWFilterObjFindByName.
      
      The fix is to add an exclusive mutex to serialize the
      execution of __virNWFilterInstantiateFilter.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      925de19e
    • R
      Fix locking in virsh console · 356bf55e
      Roman Bogorodskiy 提交于
      vshRunConsole() uses virCondWait() which is a wrapper around
      pthread_cond_wait(). On FreeBSD, pthread_cond_wait needs mutex to be
      locked, otherwise it immediately fails with EPERM. On Linux, the
      behaviour in this case is undefined.
      
      So lock the mutex before calling virCondWait().
      356bf55e
    • M
      virsh: Sort options alphabetically · fb235130
      Martin Kletzander 提交于
      Man page, help output and also parsing is sorted in order to find
      options smoothly.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      fb235130
    • J
      tests: Fix SELinux tests in VPATH build · 8922c3d0
      Jiri Denemark 提交于
      8922c3d0
  2. 08 3月, 2014 1 次提交
    • J
      virscsi: Introduce virSCSIDeviceUsedByInfoFree · ea1eadd6
      John Ferlan 提交于
      This resolves a Coverity RESOURCE_LEAK issue introduced by commit
      id 'de6fa535' where the virSCSIDeviceSetUsedBy() didn't VIR_FREE
      the 'copy' or possibly VIR_STRDUP()'d values.  It also ensures that
      the VIR_APPEND_ELEMENT is successful...
      ea1eadd6
  3. 07 3月, 2014 5 次提交
  4. 06 3月, 2014 4 次提交
  5. 05 3月, 2014 7 次提交
    • P
      qemu: monitor: Provide more information in generic block job error · 3e04d65a
      Peter Krempa 提交于
      The qemuMonitorJSONBlockJob handles a few errors internally. If qemu
      returns a different error we would report a rather unhelpful message:
      
       $ virsh blockpull gluster-job vda --base /dev/null
       error: internal error: Unexpected error
      
      As the actual message from qemu contains a bit more info, let's use it
      to report something a little more useful:
      
       $ virsh blockpull gluster-job vda --base /dev/null
       error: internal error: Unexpected error: (GenericError) 'Base '/dev/null' not found'
      3e04d65a
    • P
      doc: storage: Explicitly state that it's possible to have non-unique key · aa50a5c7
      Peter Krempa 提交于
      With most of our storage backends it's possible to have two separate
      volume keys to point to a single volume. (By creating sym/hard-links to
      local files or by mounting remote filesystems to two different locations
      and creating pools on top of them) Document this possibility.
      aa50a5c7
    • P
      storage: Don't lie about path used to look up in error message · 46446313
      Peter Krempa 提交于
      In storageVolLookupByPath the provided path is "sanitized" at first.
      This removes some extra slashes and stuff. When the lookup of the volume
      fails the original path is used which makes it hard to trace errors in
      some cases.
      
      Improve the error message to print the sanitized path along with the
      user provided path if they are not equal.
      46446313
    • P
      storage: Avoid mangling paths of non-local filesystems when looking up · 7fb3902b
      Peter Krempa 提交于
      When looking up a volume by path on a non-local filesystem don't use the
      "cleaned" path that might be mangled in such a way that it will differ
      from a path provided by a storage backend.
      
      Skip the cleanup step for gluster, sheepdog and RBD.
      7fb3902b
    • P
      storage: Error out when attempting to vol-upload into a remote pool · 429bf253
      Peter Krempa 提交于
      Pools that are not backed by files in the filesystem cause problems with
      some APIs. Error out when attempting to upload a volume in such a pool
      as currently we expect a local file representation for it.
      429bf253
    • P
      storage: Use cleanup label instead of out · e45c30ee
      Peter Krempa 提交于
      e45c30ee
    • P
      virsh: volume: Fix lookup of volumes to provide better error messages · a751e345
      Peter Krempa 提交于
      If a user specifies the pool explicitly, we should make sure to point
      out that it's inactive instead of falling back to lookup by key/path and
      failing at the end. Also if the pool isn't found there's no use in
      continuing the lookup.
      
      This changes the error in case the user-selected pool is inactive from:
      
       $ virsh vol-upload --pool inactivepool --vol somevolname volcontents
       error: failed to get vol 'somevolname'
       error: Storage volume not found: no storage vol with matching path
       somevolname
      
      To a more descriptive:
      
       $ virsh vol-upload --pool inactivepool --vol somevolname volcontents
       error: pool 'inactivepool' is not active
      
      And in case a user specifies an invalid pool from:
      
       $ virsh vol-upload --pool invalidpool --vol somevolname volcontents
       error: failed to get pool 'invalidpool'
       error: failed to get vol 'somevolname', specifying --pool might help
       error: Storage volume not found: no storage vol with matching path somevolname
      
      To something less confusing:
      
       $ virsh vol-upload --pool invalidpool --vol somevolname volcontents
       error: failed to get pool 'invalidpool'
       error: Storage pool not found: no storage pool with matching name 'invalidpool'
      a751e345
  6. 04 3月, 2014 17 次提交