1. 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
  2. 09 2月, 2017 1 次提交
  3. 15 12月, 2016 2 次提交
  4. 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
  5. 10 10月, 2016 3 次提交
  6. 26 6月, 2016 1 次提交
  7. 08 6月, 2016 2 次提交
  8. 20 5月, 2016 1 次提交
  9. 16 5月, 2016 1 次提交
  10. 04 5月, 2016 1 次提交
  11. 03 5月, 2016 2 次提交
  12. 15 4月, 2016 1 次提交
  13. 13 4月, 2016 1 次提交
  14. 11 3月, 2016 2 次提交
  15. 17 2月, 2016 2 次提交
  16. 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
  17. 15 7月, 2015 1 次提交
  18. 28 6月, 2015 1 次提交
  19. 19 6月, 2015 1 次提交
    • M
      daemonSetupNetworking: Don't leak services · 058d18bd
      Michal Privoznik 提交于
      When setting up the daemon networking, new services are created. These
      services then have sockets to listen on. Once created, the service
      objects are added to corresponding server object. However, during that
      process, server increases reference counter of the service object. So,
      at the end of the function, we should decrease it again. This way the
      service objects will have only 1 reference, but that's okay since
      servers are the only objects having a reference.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      058d18bd
  20. 18 6月, 2015 1 次提交
  21. 16 6月, 2015 2 次提交
  22. 11 6月, 2015 1 次提交
  23. 12 5月, 2015 1 次提交
  24. 02 4月, 2015 2 次提交
    • J
      Do not include cpu_map.h in libvirtd.c · 95964058
      Ján Tomko 提交于
      No longer needed after commit dd477238
      95964058
    • J
      Remove unused macros · a0482396
      Ján Tomko 提交于
      In the order of appearance:
      
      * MAX_LISTEN - never used
        added by 23ad665c (qemud) and addec57 (lock daemon)
      
      * NEXT_FREE_CLASS_ID - never used, added by 07d1b6b5
      
      * virLockError - never used, added by eb8268a4
      
      * OPENVZ_MAX_ARG, CMDBUF_LEN, CMDOP_LEN
        unused since the removal of ADD_ARG_LIT in d8b31306
      
      * QEMU_NB_PER_CPU_STAT_PARAM - unused since 897808e7
      
      * QEMU_CMD_PROMPT, QEMU_PASSWD_PROMPT - unused since 1dc10a7b
      
      * TEST_MODEL_WORDSIZE - unused since c25c18f7
      
      * TEMPDIR - never used, added by 714bef5b
      
      * NSIG - workaround around old headers
        added by commit 60ed1d2a
        unused since virExec was moved by commit 02e86910
      
      * DO_TEST_PARSE - never used, added by 9afa0060
      
      * DIFF_MSEC, GETTIMEOFDAY - unused since eee6eb66
      a0482396
  25. 19 2月, 2015 1 次提交
    • P
      daemon: Fix segfault by reloading daemon right after start · 5c756e58
      Pavel Hrdina 提交于
      Libvirt could crash with segfault if user issue "service reload" right
      after "service start". One possible way to crash libvirt is to run reload
      during initialization of QEMU driver.
      
      It could happen when qemu driver will initialize qemu_driver_lock but
      don't have a time to set it's "config" and the SIGHUP arrives. The
      reload handler tries to get qemu_drv->config during "virStorageAutostart"
      and dereference it which ends with segfault.
      
      Let's ignore all reload requests until all drivers are initialized. In
      addition set driversInitialized before we enter virStateCleanup to
      ignore reload request while we are shutting down.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1179981Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      5c756e58
  26. 27 1月, 2015 2 次提交
    • J
      Fix shadowed variable warning · d0ab79e9
      Ján Tomko 提交于
      libvirtd.c: In function 'daemonSetupAccessManager':
      libvirtd.c:730:18: error: declaration of 'driver' shadows
        a global declaration [-Werror=shadow]
           const char **driver = (const char **)config->access_drivers;
                        ^
      In file included from libvirtd.c:95:0:
      ../src/node_device/node_device_driver.h:43:36: error: shadowed
        declaration is here [-Werror=shadow]
       extern virNodeDeviceDriverStatePtr driver;
                                          ^
      d0ab79e9
    • D
      Removing probing of secondary drivers · 55ea7be7
      Daniel P. Berrange 提交于
      For stateless, client side drivers, it is never correct to
      probe for secondary drivers. It is only ever appropriate to
      use the secondary driver that is associated with the
      hypervisor in question. As a result the ESX & HyperV drivers
      have both been forced to do hacks where they register no-op
      drivers for the ones they don't implement.
      
      For stateful, server side drivers, we always just want to
      use the same built-in shared driver. The exception is
      virtualbox which is really a stateless driver and so wants
      to use its own server side secondary drivers. To deal with
      this virtualbox has to be built as 3 separate loadable
      modules to allow registration to work in the right order.
      
      This can all be simplified by introducing a new struct
      recording the precise set of secondary drivers each
      hypervisor driver wants
      
      struct _virConnectDriver {
          virHypervisorDriverPtr hypervisorDriver;
          virInterfaceDriverPtr interfaceDriver;
          virNetworkDriverPtr networkDriver;
          virNodeDeviceDriverPtr nodeDeviceDriver;
          virNWFilterDriverPtr nwfilterDriver;
          virSecretDriverPtr secretDriver;
          virStorageDriverPtr storageDriver;
      };
      
      Instead of registering the hypervisor driver, we now
      just register a virConnectDriver instead. This allows
      us to remove all probing of secondary drivers. Once we
      have chosen the primary driver, we immediately know the
      correct secondary drivers to use.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      55ea7be7
  27. 15 11月, 2014 1 次提交
  28. 29 10月, 2014 1 次提交
  29. 15 9月, 2014 2 次提交
    • J
      daemon: Resolve Coverity FORWARD_NULL · 1f967758
      John Ferlan 提交于
      Coverity complains that the comparison:
      
        if (nfds && nfds > ((int)!!sock_path + (int)!!sock_path_ro))
      
      could mean 'sock_path' is NULL. Later in virNetSocketNewListenUNIX
      there's a direct dereference of path in the error path:
      
        if (path[0] != '@')
      
      A bit of sleuthing proves that upon entry to daemonSetupNetworking
      there is no way for 'sock_path' to be NULL since daemonUnixSocketPaths
      will set up 'sock_file' (although it may not set up 'sock_file_ro')
      in all 3 paths.
      
      Adjusted code to add ATTRIBUTE_NONNULL(3) on incoming path parameter and
      then fixup the comparison of nfds to be a comparison against 2 or 1
      depending on whether sock_path_ro is NULL or not.
      1f967758
    • M
      8035f2e6