1. 23 3月, 2018 2 次提交
    • D
      remote: remove some __sun conditionals · da1ade7a
      Daniel P. Berrangé 提交于
      The libvirtd daemon has some arbitrary logic to drop privileges, but
      only on Solaris platforms. This was added during Xen days, when Xen was
      the only driver running in libvirtd. There's no expectation or testing
      that this works with the new libxl stack, nor whether dropping
      privileges breaks any of the secondary drivers. Finally, we'll be
      splitting drivers out into their own independant daemons, so this won't
      be applicable to libvirtd in future anyway.
      
      The remote driver client meanwhile arbitrarily disables daemon
      auto-spawn when connecting as non-root, breaking a key feature of
      libvirt unprivileged connections.
      
      Since we've not had any contributions for Solaris since circa 2012
      and we don't do any CI testing we should consider this platform
      unmaintained and thus reasonable to remove this cruft. If someone steps
      forward to maintain Solaris again, this code would need re-evaluating to
      come up with something more targetted.
      
      There's various __sun conditionals in the Xen driver code, but those are
      not touched. This is all for the legacy Xen driver, which will be
      entirely removed at some point in future, so not benefit to hacking out
      just the Solaris parts.
      Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      da1ade7a
    • D
      rpc: remove remains of obsolete log_buffer_size config parameter · 65824a7e
      Daniel P. Berrangé 提交于
      The global log buffer feature was deleted in:
      
        commit c0c8c1d7
        Author: Daniel P. Berrange <berrange@redhat.com>
        Date:   Mon Mar 3 14:54:33 2014 +0000
      
          Remove global log buffer feature entirely
      
          A earlier commit changed the global log buffer so that it only
          records messages that are explicitly requested via the log
          filters setting. This removes the performance burden, and
          improves the signal/noise ratio for messages in the global
          buffer. At the same time though, it is somewhat pointless, since
          all the recorded log messages are already going to be sent to an
          explicit log output like syslog, stderr or the journal. The
          global log buffer is thus just duplicating this data on stderr
          upon crash.
      
          The log_buffer_size config parameter is left in the augeas
          lens to prevent breakage for users on upgrade. It is however
          completely ignored hereafter.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      
      This was in the 1.2.3 release, and 4 years is sufficient time for a
      graceful upgrade path for augeas, so all remaining traces are now
      removed.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      65824a7e
  2. 16 3月, 2018 4 次提交
  3. 15 3月, 2018 1 次提交
  4. 14 3月, 2018 2 次提交
  5. 13 3月, 2018 1 次提交
    • J
      libvirtd: fix potential deadlock when reloading · 33c6eb96
      Jim Fehlig 提交于
      It is possible to deadlock libvirtd when concurrently starting a domain
      and restarting the daemon. Threads involved in the deadlock are
      
      Thread 4 (Thread 0x7fc13b53e700 (LWP 64084)):
      /lib64/libpthread.so.0
          at util/virthread.c:154
          at qemu/qemu_monitor.c:1083
          cmd=0x7fc110017700, scm_fd=-1, reply=0x7fc13b53d318) at
      qemu/qemu_monitor_json.c:305
      cmd=0x7fc110017700,
          reply=0x7fc13b53d318) at qemu/qemu_monitor_json.c:335
          at qemu/qemu_monitor_json.c:1298
          at qemu/qemu_monitor.c:1697
          vm=0x7fc110003d00, asyncJob=QEMU_ASYNC_JOB_START) at qemu/qemu_process.c:1763
      vm=0x7fc110003d00,
          asyncJob=6, logCtxt=0x7fc1100089c0) at qemu/qemu_process.c:1835
          vm=0x7fc110003d00, asyncJob=6, logCtxt=0x7fc1100089c0) at
      qemu/qemu_process.c:2180
      driver=0x7fc12004e1e0,
          vm=0x7fc110003d00, asyncJob=QEMU_ASYNC_JOB_START, incoming=0x0, snapshot=0x0,
          vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE, flags=17) at qemu/qemu_process.c:6111
      driver=0x7fc12004e1e0,
          vm=0x7fc110003d00, updatedCPU=0x0, asyncJob=QEMU_ASYNC_JOB_START,
      migrateFrom=0x0,
          migrateFd=-1, migratePath=0x0, snapshot=0x0,
      vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
          flags=17) at qemu/qemu_process.c:6334
          xml=0x7fc110000ed0 "<!--\nWARNING: THIS IS AN AUTO-GENERATED FILE.
      CHANGES TO IT ARE LIKELY TO BE\nOVERWRITTEN AND LOST. Changes to this xml
      configuration should be made using:\n  virsh edit testvv\nor other
      applicati"..., flags=0) at qemu/qemu_driver.c:1776
      ...
      
      Thread 1 (Thread 0x7fc143c66880 (LWP 64081)):
      /lib64/libpthread.so.0
          at util/virthread.c:122
      conf/nwfilter_conf.c:159
      sig=0x7ffe0a831e30,
          opaque=0x0) at remote/remote_daemon.c:724
          opaque=0x558c5328b230) at rpc/virnetdaemon.c:654
          at util/vireventpoll.c:508
      rpc/virnetdaemon.c:858
      remote/remote_daemon.c:1496
      (gdb) thr 1
      [Switching to thread 1 (Thread 0x7fc143c66880 (LWP 64081))]
      /lib64/libpthread.so.0
      (gdb) f 1
          at util/virthread.c:122
      122	    pthread_rwlock_wrlock(&m->lock);
      (gdb) p updateLock
      $1 = {lock = {__data = {__lock = 0, __nr_readers = 1, __readers_wakeup = 0,
            __writer_wakeup = 0, __nr_readers_queued = 0, __nr_writers_queued = 1,
      __writer = 0,
            __shared = 0, __rwelision = 0 '\000', __pad1 = "\000\000\000\000\000\000",
            __pad2 = 0, __flags = 0},
          __size = "\000\000\000\000\001", '\000' <repeats 15 times>, "\001",
      '\000' <repeats 34 times>, __align = 4294967296}}
      
      Reloading of the nwfilter driver is stuck waiting for a write lock, which
      already has a reader (from qemuDomainCreateXML) in the critical section.
      Since the reload occurs in the context of the main event loop thread,
      libvirtd becomes deadlocked. The deadlock can be avoided by offloading
      the reload work to a thread.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      33c6eb96
  6. 09 3月, 2018 1 次提交
  7. 06 3月, 2018 1 次提交
  8. 26 2月, 2018 1 次提交
  9. 22 2月, 2018 6 次提交
  10. 09 2月, 2018 1 次提交
  11. 03 11月, 2017 1 次提交
    • A
      Remove backslash alignment attempts · 3e7db8d3
      Andrea Bolognani 提交于
      Right-aligning backslashes when defining macros or using complex
      commands in Makefiles looks cute, but as soon as any changes is
      required to the code you end up with either distractingly broken
      alignment or unnecessarily big diffs where most of the changes
      are just pushing all backslashes a few characters to one side.
      
      Generated using
      
        $ git grep -El '[[:blank:]][[:blank:]]\\$' | \
          grep -E '*\.([chx]|am|mk)$$' | \
          while read f; do \
            sed -Ei 's/[[:blank:]]*[[:blank:]]\\$/ \\/g' "$f"; \
          done
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      3e7db8d3
  12. 19 10月, 2017 1 次提交
  13. 14 10月, 2017 1 次提交
  14. 25 9月, 2017 1 次提交
  15. 29 8月, 2017 2 次提交
  16. 26 8月, 2017 1 次提交
  17. 04 8月, 2017 1 次提交
  18. 25 6月, 2017 1 次提交
    • J
      events: Avoid double free possibility on remote call failure · 2065499b
      John Ferlan 提交于
      If a remote call fails during event registration (more than likely from
      a network failure or remote libvirtd restart timed just right), then when
      calling the virObjectEventStateDeregisterID we don't want to call the
      registered @freecb function because that breaks our contract that we
      would only call it after succesfully returning.  If the @freecb routine
      were called, it could result in a double free from properly coded
      applications that free their opaque data on failure to register, as seen
      in the following details:
      
          Program terminated with signal 6, Aborted.
          #0  0x00007fc45cba15d7 in raise
          #1  0x00007fc45cba2cc8 in abort
          #2  0x00007fc45cbe12f7 in __libc_message
          #3  0x00007fc45cbe86d3 in _int_free
          #4  0x00007fc45d8d292c in PyDict_Fini
          #5  0x00007fc45d94f46a in Py_Finalize
          #6  0x00007fc45d960735 in Py_Main
          #7  0x00007fc45cb8daf5 in __libc_start_main
          #8  0x0000000000400721 in _start
      
      The double dereference of 'pyobj_cbData' is triggered in the following way:
      
          (1) libvirt_virConnectDomainEventRegisterAny is invoked.
          (2) the event is successfully added to the event callback list
              (virDomainEventStateRegisterClient in
              remoteConnectDomainEventRegisterAny returns 1 which means ok).
          (3) when function remoteConnectDomainEventRegisterAny is hit,
              network connection disconnected coincidently (or libvirtd is
              restarted) in the context of function 'call' then the connection
              is lost and the function 'call' failed, the branch
              virObjectEventStateDeregisterID is therefore taken.
          (4) 'pyobj_conn' is dereferenced the 1st time in
              libvirt_virConnectDomainEventFreeFunc.
          (5) 'pyobj_cbData' (refered to pyobj_conn) is dereferenced the
               2nd time in libvirt_virConnectDomainEventRegisterAny.
          (6) the double free error is triggered.
      
      Resolve this by adding a @doFreeCb boolean in order to avoid calling the
      freeCb in virObjectEventStateDeregisterID for any remote call failure in
      a remoteConnect*EventRegister* API. For remoteConnect*EventDeregister* calls,
      the passed value would be true indicating they should run the freecb if it
      exists; whereas, it's false for the remote call failure path.
      
      Patch based on the investigation and initial patch posted by
      fangying <fangying1@huawei.com>.
      2065499b
  19. 13 6月, 2017 1 次提交
  20. 05 6月, 2017 1 次提交
  21. 26 5月, 2017 1 次提交
  22. 18 5月, 2017 8 次提交