1. 21 6月, 2019 1 次提交
    • D
      remote: delete the avahi mDNS support · 5a148ce8
      Daniel P. Berrangé 提交于
      Libvirtd has long had integration with avahi for advertising libvirtd
      using mDNS when TCP/TLS listening is enabled. For a long time the
      virt-manager application had support for auto-detecting libvirtds
      on the local network using mDNS, but this was removed last year
      
        commit fc8f8d5d7e3ba80a0771df19cf20e84a05ed2422
        Author: Cole Robinson <crobinso@redhat.com>
        Date:   Sat Oct 6 20:55:31 2018 -0400
      
          connect: Drop avahi support
      
          Libvirtd can advertise itself over avahi. The feature is disabled by
          default though and in practice I hear of no one actually using it
          and frankly I don't think it's all that useful
      
          The 'Open Connection' wizard has a disproportionate amount of code
          devoted to this feature, but I don't think it's useful or worth
          maintaining, so let's drop it
      
      I've never heard of any other applications having support for using
      mDNS to detect libvirtd instances. Though it is theoretically possible
      something exists out there, it is clearly going to be a niche use case
      in the virt ecosystem as a whole.
      
      By removing avahi integration we can cut down the dependency chain for
      the basic libvirtd install and reduce our code maint burden.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      5a148ce8
  2. 13 6月, 2019 1 次提交
  3. 21 5月, 2019 1 次提交
  4. 17 5月, 2019 1 次提交
    • D
      src: don't statically link code that's already in libvirt.so · e5df4ede
      Daniel P. Berrangé 提交于
      Various binaries are statically linking to libvirt_util.la and
      other intermediate libraries we build. These intermediate libs
      all get built into the main libvirt.so shared library eventually,
      so we can dynamically link to that instead and reduce the on disk
      footprint.
      
      In libvirt-daemon RPM:
      
                  virtlockd: 1.6 MB -> 153 KB
                   virtlogd: 1.6 MB -> 157 KB
           libvirt_iohelper: 937 KB -> 23 KB
      
      In libvirt-daemon-driver-network RPM:
      
       libvirt_leaseshelper: 940 KB -> 26 KB
      
      In libvirt-daemon-driver-storage-core RPM:
      
         libvirt_parthelper: 926 KB -> 21 KB
      
      IOW, about 5.6 MB total space saving in a build done on Fedora 30
      x86_64 architecture.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      e5df4ede
  5. 12 4月, 2019 3 次提交
  6. 10 4月, 2019 3 次提交
  7. 16 3月, 2019 1 次提交
  8. 14 3月, 2019 1 次提交
  9. 04 2月, 2019 3 次提交
  10. 18 12月, 2018 1 次提交
    • D
      logging: ensure pending I/O is drained before reading position · cc9e80c5
      Daniel P. Berrangé 提交于
      The virtualization driver has two connections to the virtlogd daemon,
      one pipe fd for writing to the log file, and one socket fd for making
      RPC calls. The typical sequence is to write some data to the pipe fd and
      then make an RPC call to determine the current log file offset.
      
      Unfortunately these two operations are not guaranteed to be handling in
      order by virtlogd. The event loop for virtlogd may identify an incoming
      event on both the pipe fd and socket fd in the same iteration of the
      event loop. It is then entirely possible that it will process the socket
      fd RPC call before reading the pending log data from the pipe fd.
      
      As a result the virtualization driver will get an outdated log file
      offset reported back.
      
      This can be seen with the QEMU driver where, when a guest fails to
      start, it will randomly include too much data in the error message it
      has fetched from the log file.
      
      The solution is to ensure we have drained all pending data from the pipe
      fd before reporting the log file offset. The pipe fd is always in
      blocking mode, so cares needs to be taken to avoid blocking. When
      draining this is taken care of by using poll(). The extra complication
      is that they might already be an event loop dispatch pending on the pipe
      fd. If we have just drained the pipe this pending event will be invalid
      so must be discarded.
      
      See also https://bugzilla.redhat.com/show_bug.cgi?id=1356108Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      cc9e80c5
  11. 14 12月, 2018 3 次提交
    • D
      Enforce a standard header file guard symbol name · 568a4172
      Daniel P. Berrangé 提交于
      Require that all headers are guarded by a symbol named
      
        LIBVIRT_$FILENAME
      
      where $FILENAME is the uppercased filename, with all characters
      outside a-z changed into '_'.
      
      Note we do not use a leading __ because that is technically a
      namespace reserved for the toolchain.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      568a4172
    • D
      Fix many mistakes & inconsistencies in header file layout · 4cfd7090
      Daniel P. Berrangé 提交于
      This introduces a syntax-check script that validates header files use a
      common layout:
      
        /*
         ...copyright header...
         */
        <one blank line>
        #ifndef SYMBOL
        # define SYMBOL
        ....content....
        #endif /* SYMBOL */
      
      For any file ending priv.h, before the #ifndef, we will require a
      guard to prevent bogus imports:
      
        #ifndef SYMBOL_ALLOW
        # error ....
        #endif /* SYMBOL_ALLOW */
        <one blank line>
      
      The many mistakes this script identifies are then fixed.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      4cfd7090
    • D
      Remove all Author(s): lines from source file headers · 60046283
      Daniel P. Berrangé 提交于
      In many files there are header comments that contain an Author:
      statement, supposedly reflecting who originally wrote the code.
      In a large collaborative project like libvirt, any non-trivial
      file will have been modified by a large number of different
      contributors. IOW, the Author: comments are quickly out of date,
      omitting people who have made significant contribitions.
      
      In some places Author: lines have been added despite the person
      merely being responsible for creating the file by moving existing
      code out of another file. IOW, the Author: lines give an incorrect
      record of authorship.
      
      With this all in mind, the comments are useless as a means to identify
      who to talk to about code in a particular file. Contributors will always
      be better off using 'git log' and 'git blame' if they need to  find the
      author of a particular bit of code.
      
      This commit thus deletes all Author: comments from the source and adds
      a rule to prevent them reappearing.
      
      The Copyright headers are similarly misleading and inaccurate, however,
      we cannot delete these as they have legal meaning, despite being largely
      inaccurate. In addition only the copyright holder is permitted to change
      their respective copyright statement.
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      60046283
  12. 20 9月, 2018 1 次提交
  13. 05 6月, 2018 1 次提交
  14. 12 5月, 2018 1 次提交
  15. 11 5月, 2018 1 次提交
    • J
      util: Clean up consumers of virJSONValueArraySize · 4a3d6ed5
      John Ferlan 提交于
      Rather than have virJSONValueArraySize return a -1 when the input
      is not an array and then splat an error message, let's check for
      an array before calling and then change the return to be a size_t
      instead of ssize_t.
      
      That means using the helper virJSONValueIsArray as well as using a
      more generic error message such as "Malformed <something> array".
      In some cases we can remove stack variables and when we cannot,
      those variables should be size_t not ssize_t. Alter a few references
      of if (!value) to be if (value == 0) instead as well.
      
      Some callers can already assume an array is being worked on based
      on the previous call, so there's less to do.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      4a3d6ed5
  16. 26 4月, 2018 1 次提交
  17. 18 4月, 2018 1 次提交
    • M
      virobject: Introduce VIR_CLASS_NEW() macro · 10f94828
      Michal Privoznik 提交于
      So far we are repeating the following lines over and over:
      
        if (!(virSomeObjectClass = virClassNew(virClassForObject(),
                                   "virSomeObject",
                                   sizeof(virSomeObject),
                                   virSomeObjectDispose)))
            return -1;
      
      While this works, it is impossible to do some checking. Firstly,
      the class name (the 2nd argument) doesn't match the name in the
      code in all cases (the 3rd argument). Secondly, the current style
      is needlessly verbose. This commit turns example into following:
      
        if (!(VIR_CLASS_NEW(virSomeObject,
                            virClassForObject)))
            return -1;
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      10f94828
  18. 23 3月, 2018 2 次提交
    • D
      rpc: avoid duplicating config in virtlockd/virtlogd augeas tests · 76e1720c
      Daniel P. Berrangé 提交于
      Most of the augeas test files use ::CONFIG:: to pull in the master
      config file for testing. This ensures that entries added to the config
      file are actually tested by augeas.
      
      This identified the missing admin_max_clients example in the virtlogd
      config file, which in turn prompted a change in description of the
      max_clients parameter, since these daemons don't have separate
      readonly & readwrite sockets.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      76e1720c
    • 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
  19. 08 3月, 2018 1 次提交
  20. 06 3月, 2018 1 次提交
  21. 31 1月, 2018 2 次提交
  22. 15 11月, 2017 1 次提交
  23. 26 10月, 2017 1 次提交
    • C
      Increase default file handle limits for virtlogd · d7444764
      Christian Ehrhardt 提交于
      The initial assumption was ~2 files per guest, but some common setups
      like Openstack drive up to 4 files per guest.
      
      E.g. on Arm where the following XML leads to 4 file handles:
          <serial type='file'>
            <source path='/var/lib/nova/instances/7c0dcd78-.../console.log'/>
            <target port='0'/>
            <alias name='serial0'/>
          </serial>
          <console type='file'>
            <source path='/var/lib/nova/instances/7c0dcd78-.../console.log'/>
            <target type='serial' port='0'/>
            <alias name='serial0'/>
          </console>
      
      With that in mind and the target to support 4k guests by default we
      should raise the limit to 16k.
      Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
      d7444764
  24. 16 10月, 2017 1 次提交
  25. 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
  26. 28 6月, 2017 1 次提交
  27. 18 3月, 2017 1 次提交
    • P
      (log|lock)daemon: Don't spam logs with IO error messages after client disconnects · f0803dae
      Peter Krempa 提交于
      The log and lock protocol don't have an extra handshake to close the
      connection. Instead they just close the socket. Unfortunately that
      resulted into a lot of spurious garbage logged to the system log files:
      
      2017-03-17 14:00:09.730+0000: 4714: error : virNetSocketReadWire:1800 : End of file while reading data: Input/output error
      
      or in the journal as:
      
      Mar 13 16:19:33 xxxx virtlogd[32360]: End of file while reading data: Input/output error
      
      Use the new facility in the netserverclient to suppress the IO error
      report from the virNetSocket layer.
      f0803dae
  28. 16 3月, 2017 1 次提交
    • D
      Increase default file handle limits for daemons · 27cd7635
      Daniel P. Berrange 提交于
      Linux still defaults to a 1024 open file handle limit. This causes
      scalability problems for libvirtd / virtlockd / virtlogd on large
      hosts which might want > 1024 guest to be running. In fact if each
      guest needs > 1 FD, we can't even get to 500 guests. This is not
      good enough when we see machines with 100's of physical cores and
      TBs of RAM.
      
      In comparison to other memory requirements of libvirtd & related
      daemons, the resource usage associated with open file handles
      is essentially line noise. It is thus reasonable to increase the
      limits unconditionally for all installs.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      27cd7635
  29. 15 12月, 2016 2 次提交