1. 20 8月, 2015 1 次提交
  2. 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
  3. 27 7月, 2015 1 次提交
    • M
      admin: Tiny cleanups · 7868f017
      Martin Kletzander 提交于
      First hunk changes the use of srcdir to top_srcdir so it complies with
      other rules in the Makefile.  Second one removes the need of
      remote_protocol.h in admin_protocol.h as it was suggested and worked in,
      but this one line was missed apparently.  Last one just removes the
      'remote' naming from admin protocol specification, just so it's cleaner.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      7868f017
  4. 15 7月, 2015 1 次提交
  5. 28 6月, 2015 1 次提交
  6. 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
  7. 18 6月, 2015 2 次提交
    • P
      daemon: Add the admin service to the admin server only if it was allocated · d7d910d9
      Peter Krempa 提交于
      If the admin service is disabled it would not be allocated, but the NULL
      pointer still would be added to the admin server. Since
      virNetServerAddService would dereference it, the daemon would crash.
      
      Move the service registration into the block that allocates it.
      d7d910d9
    • M
      daemon: Don't just include admin RPC · 13e5ea8b
      Michal Privoznik 提交于
      So, it's a little paradox that we use the file twice. Firstly to build
      libvirt-admin.la (a client side of the Admin API), then once again to
      build the server side. Well, the problem is, this does not play nicely
      with the distclean since the file is generated. So while it's removed
      in the src/ the distclean running in daemon/ will not find the file
      and fail. The file is needed because it contains the RPC wrappers. So
      let's leave the client code as is and from the daemon/ just link the
      client library. The linker will find desired symbols and use them.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      13e5ea8b
  8. 17 6月, 2015 2 次提交
  9. 16 6月, 2015 5 次提交
  10. 11 6月, 2015 1 次提交
  11. 05 6月, 2015 1 次提交
    • E
      remote: fix odd comma operator · c7d0da23
      Eric Blake 提交于
      Commit 1882c0bd accidentally used ',' instead of ';'; oddly
      enough, the result was still syntactically valid (yes, C is
      a fun language).  But it made me do a double take; it's better
      to use idiomatic syntax.
      
      * daemon/remote.c (remoteRelayDomainEventDeviceAdded): Fix
      harmless typo.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c7d0da23
  12. 12 5月, 2015 1 次提交
  13. 11 5月, 2015 1 次提交
    • P
      util: Make the virDomainListFree helper more universal · a5e89ae1
      Peter Krempa 提交于
      Extend it to a universal helper used for clearing lists of any objects.
      Note that the argument type is specifically void * to allow implicit
      typecasting.
      
      Additionally add a helper that works on non-NULL terminated arrays once
      we know the length.
      a5e89ae1
  14. 05 5月, 2015 2 次提交
    • J
      libxl: add logrotate config file · 77664cb4
      Jim Fehlig 提交于
      Add logrotate config for log files in /var/log/libvirt/libxl.
      77664cb4
    • C
      polkit: Allow password-less access for 'libvirt' group · e94979e9
      Cole Robinson 提交于
      Many users, who admin their own machines, want to be able to access
      system libvirtd via tools like virt-manager without having to enter
      a root password. Just google 'virt-manager without password' and
      you'll find many hits. I've read at least 5 blog posts over the years
      describing slightly different ways of achieving this goal.
      
      Let's finally add official support for this.
      
      Install a polkit-1 rules file granting password-less auth for any user
      in the new 'libvirt' group. Create the group on RPM install
      
      https://bugzilla.redhat.com/show_bug.cgi?id=957300
      e94979e9
  15. 27 4月, 2015 1 次提交
  16. 16 4月, 2015 1 次提交
  17. 15 4月, 2015 1 次提交
  18. 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
  19. 26 3月, 2015 2 次提交
  20. 25 3月, 2015 2 次提交
  21. 18 3月, 2015 1 次提交
  22. 17 3月, 2015 2 次提交
    • N
      domifaddr: Implement the remote protocol · 71546d17
      Nehal J Wani 提交于
      daemon/remote.c
         * Define remoteSerializeDomainInterface, remoteDispatchDomainInterfaceAddresses
      
      src/remote/remote_driver.c
         * Define remoteDomainInterfaceAddresses
      
      src/remote/remote_protocol.x
         * New RPC procedure: REMOTE_PROC_DOMAIN_INTERFACE_ADDRESSES
         * Define structs remote_domain_ip_addr, remote_domain_interface,
           remote_domain_interfaces_addresse_args, remote_domain_interface_addresses_ret
         * Introduce upper bounds (to handle DoS attacks):
           REMOTE_DOMAIN_INTERFACE_MAX = 2048
           REMOTE_DOMAIN_IP_ADDR_MAX = 2048
           Restrictions on the maximum number of aliases per interface were
           removed after kernel v2.0, and theoretically, at present, there
           are no upper limits on number of interfaces per virtual machine
           and on the number of IP addresses per interface.
      
      src/remote_protocol-structs
         * New structs added
      Signed-off-by: NNehal J Wani <nehaljw.kkd1@gmail.com>
      71546d17
    • E
      daemon: avoid memleak when ListAll returns nothing · 3c2ff502
      Eric Blake 提交于
      Commit 4f25146b (v1.2.8) managed to silence Coverity, but at the
      cost of a memory leak detected by valgrind:
      ==24129== 40 bytes in 5 blocks are definitely lost in loss record 355 of 637
      ==24129==    at 0x4A08B1C: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==24129==    by 0x5084B8E: virReallocN (viralloc.c:245)
      ==24129==    by 0x514D5AA: virDomainObjListExport (domain_conf.c:22200)
      ==24129==    by 0x201227DB: qemuConnectListAllDomains (qemu_driver.c:18042)
      ==24129==    by 0x51CC1B6: virConnectListAllDomains (libvirt-domain.c:6797)
      ==24129==    by 0x14173D: remoteDispatchConnectListAllDomains (remote.c:1580)
      ==24129==    by 0x121BE1: remoteDispatchConnectListAllDomainsHelper (remote_dispatch.h:1072)
      
      In short, every time a client calls a ListAll variant and asks
      for the resulting list, but there are 0 elements to return, we
      end up leaking the 1-entry array that holds the NULL terminator.
      
      What's worse, a read-only client can access these functions in a
      tight loop to cause libvirtd to eventually run out of memory; and
      this can be considered a denial of service attack against more
      privileged clients.  Thankfully, the leak is so small (8 bytes per
      call) that you would already have some other denial of service with
      any guest calling the API that frequently, so an out-of-memory
      crash is unlikely enough that this did not warrant a CVE.
      
      * daemon/remote.c (remoteDispatchConnectListAllDomains)
      (remoteDispatchDomainListAllSnapshots)
      (remoteDispatchDomainSnapshotListAllChildren)
      (remoteDispatchConnectListAllStoragePools)
      (remoteDispatchStoragePoolListAllVolumes)
      (remoteDispatchConnectListAllNetworks)
      (remoteDispatchConnectListAllInterfaces)
      (remoteDispatchConnectListAllNodeDevices)
      (remoteDispatchConnectListAllNWFilters)
      (remoteDispatchConnectListAllSecrets)
      (remoteDispatchNetworkGetDHCPLeases): Plug leak.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3c2ff502
  23. 06 3月, 2015 1 次提交
  24. 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
  25. 13 2月, 2015 1 次提交
  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 12月, 2014 2 次提交