1. 09 10月, 2015 1 次提交
    • M
      virJSONValueArraySize: return ssize_t · 4f77c48c
      Michal Privoznik 提交于
      The internal representation of a JSON array counts the items in
      size_t. However, for some reason, when asking for the count it's
      reported as int. Firstly, we need the function to return a signed
      type as it's returning -1 on an error. But, not every system has
      integer the same size as size_t. Therefore, lets return ssize_t.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4f77c48c
  2. 24 8月, 2015 1 次提交
    • E
      locking: Remove redundant 'srv' element from virLockDaemon · f08b1c58
      Erik Skultety 提交于
      Now that we have virNetDaemon object holding all the data and being
      capable of referencing multiple servers, having a duplicate reference to
      a single server stored in virLockDaemon isn't necessary anymore. This
      patch removes the above described element.
      f08b1c58
  3. 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
  4. 16 6月, 2015 1 次提交
  5. 23 4月, 2015 1 次提交
    • J
      locking: relax PID requirement · ee3eddb3
      Jim Fehlig 提交于
      Some hypervisors like Xen do not have PIDs associated with domains.
      Relax the requirement for PID != 0 in the locking code so it can
      be used by hypervisors that do not represent domains as a process
      running on the host.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      ee3eddb3
  6. 02 4月, 2015 1 次提交
    • 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
  7. 15 11月, 2014 1 次提交
  8. 29 10月, 2014 1 次提交
    • E
      maint: avoid static zero init in helpers · ff99c791
      Eric Blake 提交于
      C guarantees that static variables are zero-initialized.  Some older
      compilers (and also gcc -fno-zero-initialized-in-bss) create larger
      binaries if you explicitly zero-initialize a static variable.
      
      * src/conf/nwfilter_conf.c: Fix initialization.
      * src/cpu/cpu_x86.c: Likewise.
      * src/interface/interface_backend_netcf.c: Likewise.
      * src/locking/lock_daemon.c: Likewise.
      * src/locking/lock_driver_lockd.c: Likewise.
      * src/locking/lock_driver_sanlock.c: Likewise.
      * src/network/bridge_driver.c: Likewise.
      * src/node_device/node_device_udev.c: Likewise.
      * src/nwfilter/nwfilter_learnipaddr.c: Likewise.
      * src/rpc/virnetserver.c: Likewise.
      * src/security/security_selinux.c
      (virSecuritySELinuxGenSecurityLabel): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ff99c791
  9. 15 9月, 2014 1 次提交
  10. 22 8月, 2014 2 次提交
  11. 28 4月, 2014 1 次提交
  12. 25 4月, 2014 1 次提交
  13. 25 3月, 2014 1 次提交
  14. 18 3月, 2014 4 次提交
  15. 22 1月, 2014 1 次提交
  16. 06 1月, 2014 1 次提交
    • E
      maint: improve VIR_ERR_OPERATION_DENIED usage · d219826c
      Eric Blake 提交于
      Some of our operation denied messages are outright stupid; for
      example, if virIdentitySetAttr fails:
      
      error: operation Identity attribute is already set forbidden for read only access
      
      This patch fixes things to a saner:
      
      error: operation forbidden: Identity attribute is already set
      
      It also consolidates the most common usage pattern for operation
      denied errors: read-only connections preventing a public API.  In
      this case, 'virsh -r -c test:///default destroy test' changes from:
      
      error: operation virDomainDestroy forbidden for read only access
      
      to:
      
      error: operation forbidden: read only access prevents virDomainDestroy
      
      Note that we were previously inconsistent on which APIs used
      VIR_FROM_DOM (such as virDomainDestroy) vs. VIR_FROM_NONE (such as
      virDomainPMSuspendForDuration).  After this patch, all uses
      consistently use VIR_FROM_NONE, on the grounds that it is unlikely
      that a caller learning that a call is denied can do anything in
      particular with extra knowledge which error domain the call belongs
      to (similar to what we did in commit baa72449).
      
      * src/util/virerror.c (virErrorMsg): Rework OPERATION_DENIED error
      message.
      * src/internal.h (virCheckReadOnlyGoto): New macro.
      * src/util/virerror.h (virReportRestrictedError): New macro.
      * src/libvirt-lxc.c: Use new macros.
      * src/libvirt-qemu.c: Likewise.
      * src/libvirt.c: Likewise.
      * src/locking/lock_daemon.c (virLockDaemonClientNew): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d219826c
  17. 10 12月, 2013 3 次提交
  18. 21 10月, 2013 2 次提交
  19. 19 8月, 2013 1 次提交
    • D
      Make max_clients in virtlockd configurable · 9f5b4b1f
      David Weber 提交于
      Each new VM requires a new connection from libvirtd to virtlockd.
      The default max clients limit in virtlockd of 20 is thus woefully
      insufficient. virtlockd sockets are only accessible to matching
      users, so there is no security need for such a tight limit. Make
      it configurable and default to 1024.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      9f5b4b1f
  20. 13 8月, 2013 1 次提交
    • D
      Properly handle -h / -V for --help/--version aliases in virtlockd/libvirtd · 63ba687f
      Daniel P. Berrange 提交于
      The virtlockd/libvirtd daemons had listed '?' as the short option
      for --help. getopt_long uses '?' for any unknown option. We want
      to be able to distinguish unknown options (which use EXIT_FAILURE)
      from correct usage of help (which should use EXIT_SUCCESS). Thus
      we should use 'h' as a short option for --help. Also add this to
      the man page docs
      
      The virtlockd/libvirtd daemons did not list any short option
      for the --version arg. Add -V as a valid short option, since
      -v is already used for --verbose.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      63ba687f
  21. 05 8月, 2013 1 次提交
    • M
      Introduce max_queued_clients · 1199edb1
      Michal Privoznik 提交于
      This configuration knob lets user to set the length of queue of
      connection requests waiting to be accept()-ed by the daemon. IOW, it
      just controls the @backlog passed to listen:
      
        int listen(int sockfd, int backlog);
      1199edb1
  22. 10 7月, 2013 1 次提交
  23. 21 5月, 2013 1 次提交
  24. 09 5月, 2013 1 次提交
  25. 08 5月, 2013 1 次提交
  26. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  27. 17 1月, 2013 1 次提交
  28. 14 1月, 2013 1 次提交
  29. 09 1月, 2013 1 次提交
  30. 21 12月, 2012 4 次提交