1. 14 12月, 2018 6 次提交
  2. 15 11月, 2018 1 次提交
  3. 05 11月, 2018 1 次提交
    • J
      access: Modify the VIR_ERR_ACCESS_DENIED to include driverName · ccc72d5c
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1631606
      
      Changes made to manage and utilize a secondary connection
      driver to APIs outside the scope of the primary connection
      driver have resulted in some confusion processing polkit rules
      since the simple "access denied" error message doesn't provide
      enough of a clue when combined with the "authentication failed:
      access denied by policy" as to which connection driver refused
      or failed the ACL check.
      
      In order to provide some context, let's modify the existing
      "access denied" error returne from the various vir*EnsureACL
      API's to provide the connection driver name that is causing
      the failure. This should provide the context for writing the
      polkit rules that would allow access via the driver.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
      ccc72d5c
  4. 24 9月, 2018 1 次提交
  5. 20 9月, 2018 2 次提交
  6. 27 7月, 2018 1 次提交
  7. 19 7月, 2018 1 次提交
    • N
      util: set OOM in virCopyLastError if error is not set · 1bff5bbe
      Nikolay Shirokovskiy 提交于
      virCopyLastError is intended to be used after last error is set.
      However due to virLastErrorObject failures (very unlikely though
      as thread local error is allocated on first use) we can have zero
      fields in a copy as a result. In particular code field can be set
      to VIR_ERR_OK.
      
      In some places (qemu monitor, qemu agent and qemu migaration code
      for example) we use copy result as a flag and this leads to bugs.
      
      Let's set OOM-like error in copy in case of virLastErrorObject failures.
      Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
      1bff5bbe
  8. 26 6月, 2018 1 次提交
  9. 06 6月, 2018 1 次提交
  10. 01 2月, 2018 1 次提交
  11. 07 12月, 2017 1 次提交
  12. 23 11月, 2017 1 次提交
  13. 15 9月, 2017 1 次提交
  14. 14 8月, 2017 1 次提交
  15. 15 11月, 2016 1 次提交
  16. 07 9月, 2016 1 次提交
  17. 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
  18. 03 5月, 2016 1 次提交
    • E
      admin: Introduce virAdmServerLookupClient · 52a2eef9
      Erik Skultety 提交于
      Just like with server-related APIs, before any of client-based APIs can be
      called, a reference to a client-side client object needs to be obtained. For
      this purpose, a lookup method should exist. Apart from the client retrieval
      logic, a new error code for non-existent client had to be added as well.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      52a2eef9
  19. 29 3月, 2016 1 次提交
  20. 11 3月, 2016 1 次提交
  21. 01 3月, 2016 1 次提交
    • J
      polkit: Adjust message when authentication agent isn't found · 1d35f6ff
      John Ferlan 提交于
      When there isn't a ssh -X type session running and a user has not
      been added to the libvirt group, attempts to run 'virsh -c qemu:///system'
      commands from an otherwise unprivileged user will fail with rather
      generic or opaque error message:
      
          "error: authentication failed: no agent is available to authenticate"
      
      This patch will adjust the error code and message to help reflect the
      situation that the problem is the requested mechanism is UNAVAILABLE and
      a slightly more descriptive error. The result on a failure then becomes:
      
          "error: authentication unavailable: no polkit agent available to
                  authenticate action 'org.libvirt.unix.manage'"
      
      A bit more history on this - at one time a failure generated the
      following type message when running the 'pkcheck' as a subprocess:
      
      "error: authentication failed: polkit\56retains_authorization_after_challenge=1
      Authorization requires authentication but no agent is available."
      
      but, a patch was generated to adjust the error message to help provide
      more details about what failed. This was pushed as commit id '96a108c9'.
      That patch prepended a "polkit: " to the output. It really didn't solve
      the problem, but gave a hint.
      
      After some time it was deemed using DBus API calls directly was a
      better way to go (since pkcheck calls them anyway). So, commit id
      '1b854c76' (more or less) copied the code from remoteDispatchAuthPolkit
      and adjusted it. Then commit id 'c7542573' adjusted the remote.c
      code to call the new API (virPolkitCheckAuth). Finally, commit id
      '308c0c5a' altered the code to call DBus APIs directly. In doing
      so, it reverted the failing error message to the generic message
      that would have been received from DBus anyway.
      1d35f6ff
  22. 15 2月, 2016 1 次提交
  23. 22 1月, 2016 1 次提交
  24. 26 11月, 2015 1 次提交
  25. 10 7月, 2015 2 次提交
    • J
      qemu: Don't report false error from MigrateFinish · 44c42b56
      Jiri Denemark 提交于
      virDomainMigrateFinish* APIs were unfortunately designed to return the
      pointer to the domain on destination and NULL on error. This looks OK in
      normal cases but the same API is also called when we know migration
      failed and thus we expect Finish to return NULL even if it actually did
      all it was supposed to do without any error. The call is defined to
      return nonnull domain pointer over RPC, which means returning NULL will
      always result in an error being send. If this was not in fact an error,
      the API itself wouldn't set anything to the thread local virError, which
      makes the RPC layer come up with it's own "Library function returned
      error but did not set virError" error.
      
      This is quite confusing and also hard to detect by the caller. This
      patch adds a special error code which can be used to check that Finish
      successfully aborted migration.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      44c42b56
    • J
      Introduce virErrorCopyNew · 9d0a2af6
      Jiri Denemark 提交于
      A helper function for copying error objects.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      9d0a2af6
  26. 16 6月, 2015 1 次提交
  27. 15 4月, 2015 2 次提交
  28. 25 3月, 2015 1 次提交
    • J
      Add support for tracking thread jobs · 95695388
      Jiri Denemark 提交于
      Each thread can use a thread local variable to keep the name of a job
      which is currently running in the job.
      
      The virThreadJobSetWorker API is supposed to be called once by any
      thread which is used as a worker, i.e., it is waiting in a pool, woken
      up to do a job, and returned back to the pool.
      
      The virThreadJobSet/virThreadJobClear APIs are to be called at the
      beginning/end of each job.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      95695388
  29. 26 1月, 2015 1 次提交
    • D
      systemd: fix build without dbus · d13b586a
      Daniel P. Berrange 提交于
      The virDBusMethodCall method has a DBusError as one of its
      parameters. If the caller wants to pass a non-NULL value
      for this, it immediately makes the calling code require
      DBus at build time. This has led to breakage of non-DBus
      builds several times. It is desirable that only the virdbus.c
      file should need WITH_DBUS conditionals, so we must ideally
      remove the DBusError parameter from the method.
      
      We can't simply raise a libvirt error, since the whole point
      of this parameter is to give the callers a way to check if
      the error is one they want to ignore, without having the logs
      polluted with an error message. So, we add a virErrorPtr
      parameter which the caller can then either ignore or raise
      using the new virReportErrorObject method.
      
      This new method is distinct from virSetError in that it
      ensures the logging hooks are run.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d13b586a
  30. 15 1月, 2015 1 次提交
  31. 24 9月, 2014 1 次提交
  32. 26 6月, 2014 1 次提交
    • J
      cpuCompare*: Add support for reporting failure on incompatible CPUs · b14954fc
      Jiri Denemark 提交于
      When CPU comparison APIs return VIR_CPU_COMPARE_INCOMPATIBLE, the caller
      has no clue why the CPU is considered incompatible with host CPU. And in
      some cases, it would be nice to be able to get such info in a client
      rather than having to look in logs.
      
      To achieve this, the APIs can be told to return VIR_ERR_CPU_INCOMPATIBLE
      error for incompatible CPUs and the reason will be described in the
      associated error message.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      b14954fc