1. 28 11月, 2019 1 次提交
    • M
      nss: Don't fail on empty files · d7dd4e1f
      Michal Privoznik 提交于
      Before we rewrote nss plugin so that it doesn't use libvirt's
      internal functions it used virLeaseReadCustomLeaseFile() to parse
      .status files. After the rewrite it's using read() + yajl_parse()
      + yajl_complete_parse(). There's one catch though,
      virLeaseReadCustomLeaseFile() skipped over empty files.
      
      An empty .status file is created when a network is started. This
      is because we configure dnsmasq to use our leasehelper. So the
      first thing it does it calls it as follows:
      
        DNSMASQ_INTERFACE=virbr0 /usr/libexec/libvirt_leaseshelper init
      
      which causes the leasehelper to create empty virbr0.status file.
      If there is only one libvirt network then that is no problem -
      there are no other .status files to parse anyway. But if there
      are two or more networks then the first empty .status file causes
      whole parsing process and subsequently the whole name lookup
      process to fail.
      
      Fixes: v5.7.0-rc1~343
      Reported-by: NPavel Hrdina <phrdina@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      d7dd4e1f
  2. 30 9月, 2019 4 次提交
  3. 09 8月, 2019 3 次提交
  4. 08 8月, 2019 2 次提交
    • D
      nss: fix build on freebsd · 9ce035e4
      Daniel P. Berrangé 提交于
      The conversion to drop gnulib in the previous patch:
      
        commit 8242ce4f
        Author: Daniel P. Berrangé <berrange@redhat.com>
        Date:   Thu Aug 8 10:23:26 2019 +0100
      
          tools: avoid accidentally using files from gnulib
      
      Missed a few conversions needed for FreeBSD. In particular
      netdb.h doesn't pull in sys/socket.h or netinet/in.h
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      9ce035e4
    • D
      tools: avoid accidentally using files from gnulib · 8242ce4f
      Daniel P. Berrangé 提交于
      The AM_CPPFLAGS setting includes the gnulib headers, which
      means we can get some replacement functions defined. Since
      virt-login-shell and the NSS module intentionally don't link
      to gnulib, these replacement functions causes link failures.
      
      This was seen cross-compiling on Debian for example:
      
      virt-login-shell.o: In function `main':
      /builds/libvirt/libvirt/build/tools/../../tools/virt-login-shell.c:81: undefined reference to `rpl_strerror'
      /builds/libvirt/libvirt/build/tools/../../tools/virt-login-shell.c:66: undefined reference to `rpl_strerror'
      /builds/libvirt/libvirt/build/tools/../../tools/virt-login-shell.c:75: undefined reference to `rpl_strerror'
      
      The only way to avoid these replacement gnulib headers is
      to drop the -Ignulib/lib flags. We do still want to use
      gnulib for configmake.h and intprops.h, but those can be
      included via their full path.
      
      We must also stop using internal.h, since that expects
      -Ignulib/lib to be on the include path in order to resolve
      the verify.h header.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      8242ce4f
  5. 07 8月, 2019 9 次提交
  6. 15 7月, 2019 5 次提交
  7. 19 6月, 2019 1 次提交
  8. 07 3月, 2019 2 次提交
  9. 14 12月, 2018 2 次提交
    • 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
      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
  10. 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
  11. 03 11月, 2017 1 次提交
    • A
      Remove backslash alignment attempts · 3e7db8d3
      Andrea Bolognani 提交于
      Right-aligning backslashes when defining macros or using complex
      commands in Makefiles looks cute, but as soon as any changes is
      required to the code you end up with either distractingly broken
      alignment or unnecessarily big diffs where most of the changes
      are just pushing all backslashes a few characters to one side.
      
      Generated using
      
        $ git grep -El '[[:blank:]][[:blank:]]\\$' | \
          grep -E '*\.([chx]|am|mk)$$' | \
          while read f; do \
            sed -Ei 's/[[:blank:]]*[[:blank:]]\\$/ \\/g' "$f"; \
          done
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      3e7db8d3
  12. 22 9月, 2017 2 次提交
  13. 19 1月, 2017 1 次提交
    • A
      nss: Remove RES_USE_INET6 usage · 5fff7b99
      Andrea Bolognani 提交于
      The recent deprecation in glibc (commit b76e065991ec) means the
      module will fail to build entirely:
      
        nss/libvirt_nss.c: In function '_nss_libvirt_gethostbyname_r':
        nss/libvirt_nss.c:363:13: error: RES_USE_INET6 is deprecated [-Werror]
           int af = ((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      This resolver option was removed shortly after being introduced,
      and application using it are already broken anyway.
      5fff7b99
  14. 09 12月, 2016 1 次提交
    • J
      nss: Need to check error condition on virJSONValueArraySize · 03876cf5
      John Ferlan 提交于
      If the 'nleases < 0' on return, then the subsequent call to
      findLeaseInJSON will not produce the expected results (passed
      in as a size_t, but nleases is a ssize_t).  So check if the
      returned value < 0 and if so, goto cleanup.
      
      Found by Coverity as a NEGATIVE_RETURNS event
      03876cf5
  15. 06 12月, 2016 4 次提交
  16. 05 10月, 2016 1 次提交