1. 23 3月, 2018 1 次提交
    • 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
  2. 16 3月, 2018 1 次提交
  3. 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
  4. 22 2月, 2018 1 次提交
  5. 31 1月, 2018 2 次提交
  6. 13 12月, 2017 1 次提交
  7. 18 11月, 2017 3 次提交
    • J
      libvirtd: Fix order of cleanup processing · 2f3054c2
      John Ferlan 提交于
      Current cleanup processing is ad-hoc at best - it's led to a couple of
      strange and hard to diagnose timing problems and crashes.
      
      So rather than perform cleanup in a somewhat random order, let's
      perform cleanup in the exact opposite order of startup.
      
      NB: It is possible that virNetlinkEventServerStart fails and we jump
      to cleanup before driversInitialized has been set. That could leave
      things inconsistent; however, resolution of that possibility is perhaps
      more trouble than it's worth to handle.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      2f3054c2
    • J
      libvirtd: Alter order of virNetDaemonNew · 723cadd9
      John Ferlan 提交于
      Let's be sure we can get a Daemon object before the server object.
      This is a more "orderly" way to do things since the svr object would
      be added to the dmn object afterwards.
      723cadd9
    • J
      libvirtd: Move pid_file_fd setup to before run_dir · b5726b7e
      John Ferlan 提交于
      Once we have forked the daemon successfully, let's claim the pidfile
      immediately rather than waiting for setup of run_dir.
      b5726b7e
  8. 28 8月, 2017 1 次提交
    • E
      daemon: logging: Fix --verbose option being ignored by the daemon · b988f794
      Erik Skultety 提交于
      Commit 94c465d0 refactored the logging setup phase but introduced an
      issue, where the daemon ignores verbose mode when there are no outputs
      defined and the default must be used. The problem is that the default
      output was determined too early, thus ignoring the potential '--verbose'
      option taking effect. This patch postpones the creation of the default
      output to the very last moment when nothing else can change. Since the
      default output is only created during the init phase, it's safe to leave
      the pointer as NULL for a while, but it will be set eventually, thus not
      affecting runtime.
      Patch also adjusts both the other daemons.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1442947Signed-off-by: NErik Skultety <eskultet@redhat.com>
      b988f794
  9. 27 7月, 2017 1 次提交
  10. 05 7月, 2017 1 次提交
  11. 13 6月, 2017 2 次提交
  12. 02 6月, 2017 1 次提交
  13. 16 3月, 2017 1 次提交
  14. 21 2月, 2017 1 次提交
    • P
      daemon: Refactor connection driver module loading · 633b7592
      Peter Krempa 提交于
      Pass the registration function name to virDriverLoadModule so that we
      can later call specific functions if necessary (e.g. for testing
      purposes). This gets rid of the rather ugly automatic name generator and
      unifies the code to load/initialize the modules.
      
      It's also clear which registration function gets called.
      633b7592
  15. 09 2月, 2017 1 次提交
  16. 15 12月, 2016 2 次提交
  17. 28 10月, 2016 1 次提交
    • N
      daemon: Fix crash during daemon cleanup · 85c3a182
      Nikolay Shirokovskiy 提交于
      Do not dereference the 'dmn' until after the virStateCleanup is completed.
      
      During initialization, virStateInitialize requires/uses the "dmn" as the
      argument to/for the daemonInhibitCallback functions. Thus, cleanup cannot
      dereference 'dmn' until after calling the virStateCleanup which calls the
      the daemonInhibitCallback using 'dmn'; otherwise, the following crash occurs:
      
      backtrace (shortened a bit)
      
      1  0x00007fd3a791b2e6 in virCondWait (c=<optimized out>, m=<optimized out>)
         at util/virthread.c:154
      2  0x00007fd3a791bcb0 in virThreadPoolFree (pool=0x7fd38024ee00)
         at util/virthreadpool.c:266
      3  0x00007fd38edaa00e in qemuStateCleanup () at qemu/qemu_driver.c:1116
      4  0x00007fd3a79abfeb in virStateCleanup () at libvirt.c:808
      5  0x00007fd3a85f2c9e in main (argc=<optimized out>, argv=<optimized out>)
          at libvirtd.c:1660
      
      Thread 1 (Thread 0x7fd38722d700 (LWP 32256)):
      0  0x00007fd3a7900910 in virClassIsDerivedFrom
         (klass=0xdfd36058d4853, parent=0x7fd3a8f394d0) at util/virobject.c:169
      1  0x00007fd3a7900c4e in virObjectIsClass
         (anyobj=anyobj@entry=0x7fd3a8f2f850, klass=<optimized out>)
         at util/virobject.c:365
      2  0x00007fd3a7900c74 in virObjectLock (anyobj=0x7fd3a8f2f850)
         at util/virobject.c:317
      3  0x00007fd3a7a24d5d in virNetDaemonRemoveShutdownInhibition
         (dmn=0x7fd3a8f2f850) at rpc/virnetdaemon.c:547
      4  0x00007fd38ed722cf in qemuProcessStop
         (driver=driver@entry=0x7fd380103810, vm=vm@entry=0x7fd38025b6d0,
          reason=reason@entry=VIR_DOMAIN_SHUTOFF_SHUTDOWN,
          asyncJob=asyncJob@entry=QEMU_ASYNC_JOB_NONE, flags=flags@entry=0)
         at qemu/qemu_process.c:5786
      5  0x00007fd38edd9428 in processMonitorEOFEvent
         (vm=0x7fd38025b6d0, driver=0x7fd380103810) at qemu/qemu_driver.c:4588
      6  qemuProcessEventHandler (data=<optimized out>, opaque=0x7fd380103810)
         at qemu/qemu_driver.c:4632
      7  0x00007fd3a791bb55 in virThreadPoolWorker
         (opaque=opaque@entry=0x7fd3a8f1e4c0) at util/virthreadpool.c:145
      85c3a182
  18. 10 10月, 2016 3 次提交
  19. 26 6月, 2016 1 次提交
  20. 08 6月, 2016 2 次提交
  21. 20 5月, 2016 1 次提交
  22. 16 5月, 2016 1 次提交
  23. 04 5月, 2016 1 次提交
  24. 03 5月, 2016 2 次提交
  25. 15 4月, 2016 1 次提交
  26. 13 4月, 2016 1 次提交
  27. 11 3月, 2016 2 次提交
  28. 17 2月, 2016 2 次提交
  29. 10 8月, 2015 1 次提交
    • M
      rpc: Remove keepalive_required option · a8743c39
      Martin Kletzander 提交于
      Since its introduction in 2011 (particularly in commit f4324e32),
      the option doesn't work.  It just effectively disables all incoming
      connections.  That's because the client private data that contain the
      'keepalive_supported' boolean, are initialized to zeroes so the bool is
      false and the only other place where the bool is used is when checking
      whether the client supports keepalive.  Thus, according to the server,
      no client supports keepalive.
      
      Removing this instead of fixing it is better because a) apparently
      nobody ever tried it since 2011 (4 years without one month) and b) we
      cannot know whether the client supports keepalive until we get a ping or
      pong keepalive packet.  And that won't happen until after we dispatched
      the ConnectOpen call.
      
      Another two reasons would be c) the keepalive_required was tracked on
      the server level, but keepalive_supported was in private data of the
      client as well as the check that was made in the remote layer, thus
      making all other instances of virNetServer miss this feature unless they
      all implemented it for themselves and d) we can always add it back in
      case there is a request and a use-case for it.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      a8743c39