1. 17 8月, 2017 16 次提交
  2. 16 8月, 2017 2 次提交
    • M
      libvirtd.conf: Drop max_requests · 733359a6
      Michal Privoznik 提交于
      Since its introduction in f6134117 it was never
      implemented nor there are plans to implement it. Drop it.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      733359a6
    • J
      qemu: Fix bug assuming usage of default UUID for certificate passphrase · fdab78b5
      John Ferlan 提交于
      If an environment specific _tls_x509_cert_dir is provided, then
      do not VIR_STRDUP the defaultTLSx509secretUUID as that would be
      for the "default" environment and not the vnc, spice, chardev, or
      migrate environments. If the environment needs a secret to decode
      it's certificate, then it must provide the secret. If the secrets
      happen to be the same, then configuration would use the same UUID
      as the default (but we cannot assume that nor can we assume that
      the secret would be necessary).
      fdab78b5
  3. 15 8月, 2017 10 次提交
    • J
      util: Add object checking for virObject{Ref|Unref} · d3e17259
      John Ferlan 提交于
      Rather than assuming that what's passed to virObject{Ref|Unref}
      would be a virObjectPtr as long as it's not NULL, let's do the
      similar checks virObjectIsClass in order to prevent a possible
      increment or decrement to some field at the obj->u.s.refs offset.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      d3e17259
    • J
      util: Add magic number check for object validity · dfa0efbb
      John Ferlan 提交于
      The virObjectIsClass API has only ever checked object validity
      based on if the @obj is not NULL and it was derived from some class.
      While this has worked well in general, there is one additional
      check that could be made prior to calling virClassIsDerivedFrom
      which loops through the classes checking the magic number against
      the klass expected magic number.
      
      If by chance a non virObject is passed, rather than assuming the
      void * @obj is a _virObject and thus offsetting to obj->klass,
      obj->magic, and obj->parent, let's check that the void * @obj
      has at least the "base part" of the magic number in the right
      place and generate a more specific VIR_WARN message if not.
      
      There are many consumers to virObjectIsClass, include the locking
      primitives virObject{Lock|Unlock}, virObjectRWLock{Read|Write},
      and virObjectRWUnlock. For those callers, the locking call will
      not fail, but it also will not attempt a virMutex* call which
      will "most likely" fail since the &obj->lock is used.
      
      In order to avoid some possible future wrap on the 0xCAFExxxx
      value, add a check during initialization that some new class
      won't cause the wrap. Should be good for a few years at least!
      
      It is still left up to the caller to handle the failed API calls
      just as it would be if it passed a NULL opaque pointer anyobj.
      dfa0efbb
    • J
      util: Create common error path for invalid object · 19f43952
      John Ferlan 提交于
      If virObjectIsClass fails "internally" to virobject.c, create a
      macro to generate the VIR_WARN describing what the problem is.
      Also improve the checks and message a bit to indicate which was
      the failure - whether the obj was NULL or just not the right class
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      19f43952
    • J
      util: Introduce and use virObjectRWUnlock · 045d712c
      John Ferlan 提交于
      Rather than overload virObjectUnlock as commit id '77f4593b' has
      done, create a separate virObjectRWUnlock API that will force the
      consumers to make the proper decision regarding unlocking the
      RWLock's. Similar to the RWLockRead and RWLockWrite, use the
      virObjectGetRWLockableObj helper. This restores the virObjectUnlock
      code to using the virObjectGetLockableObj.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      045d712c
    • J
      util: Introduce virObjectGetRWLockableObj · bf09f002
      John Ferlan 提交于
      Introduce a helper to handle the error path more cleanly. The same
      as virObjectGetLockableObj in order to essentially follow the original
      logic of commit 'b545f65d' to ensure that the input argument at least
      has some validity before using.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      bf09f002
    • J
      util: Only have virObjectLock handle virObjectLockable · 8b03a609
      John Ferlan 提交于
      Now that virObjectRWLockWrite exists to handle the virObjectRWLockable
      objects, let's restore virObjectLock to only handle virObjectLockable
      class locks. There still exists the possibility that the input @anyobj
      isn't a valid object and the resource isn't truly locked, but that
      also exists before commit id '77f4593b'.
      
      This also restores some logic that commit id '77f4593b' removed
      with respect to a common code path that commit id '10c2bb2b' had
      introduced as virObjectGetLockableObj. This code path merely does
      the same checks as the original virObjectLock commit 'b545f65d',
      but in callable/reusable helper to ensure the @obj at least has
      some validity before using.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      8b03a609
    • J
      util: Introduce and use virObjectRWLockWrite · 908b3364
      John Ferlan 提交于
      Instead of making virObjectLock be the entry point for two
      different types of locks, let's create a virObjectRWLockWrite API
      which will only handle the virObjectRWLockableClass objects.
      
      Use the new virObjectRWLockWrite for the virdomainobjlist code
      in order to handle the Add, Remove, Rename, and Load operations
      that need to be very synchronous.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      908b3364
    • J
      util: Rename virObjectLockRead to virObjectRWLockRead · 99a72b3e
      John Ferlan 提交于
      Since the class it represents is based on virObjectRWLockableClass
      and in order to make sure we differentiate just in case anyone somehow
      believes they could use virObjectLockRead for a virObjectLockableClass,
      let's rename the API to use the RW in the name. Besides the RW locks
      refer to pthread_rwlock_{init|rdlock|wrlock|unlock|destroy} while the
      other locks refer to pthread_mutex_{init|lock|unlock|destroy}.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      99a72b3e
    • P
      qemu: fix nwfilter deadlock in qemuProcessReconnect · 40cc355c
      Pavel Hrdina 提交于
      The correct lock order is:
      
        nwfilter driver lock (not used in this code path)
        nwfilter update lock
        virt driver lock (not used in this code path)
        domain object lock
      
      but the current code have this order:
      
        domain object lock
        nwfilter update lock
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      40cc355c
    • P
      qemu: fix nwfilter deadlock while reverting to snapshot · 231c7104
      Pavel Hrdina 提交于
      Introduced by commit <41127244>.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      231c7104
  4. 14 8月, 2017 12 次提交