1. 09 10月, 2019 1 次提交
  2. 22 8月, 2019 1 次提交
  3. 09 8月, 2019 16 次提交
  4. 07 8月, 2019 1 次提交
    • D
      tools: split virt-login-shell into two binaries · 4feeb2d9
      Daniel P. Berrangé 提交于
      The virt-login-shell binary is a setuid program that takes
      no arguments. When invoked it looks at the invoking uid,
      resolves it to a username, and finds an LXC guest with the
      same name. It then starts the guest and runs the shell in
      side the namespaces of the container.
      
      Given this set of tasks the virt-login-shell binary needs
      to connect to libvirtd, make various other libvirt API calls.
      This is a problem for setuid binaries as various libraries
      that libvirt.so links to are not safe. For example, they have
      constructor functions which execute an unknown amount of code
      that can be influenced by env variables.
      
      For this reason virt-login-shell doesn't use libvirt.so,
      but instead links to a custom, cut down, set of source files
      sufficient to be a local client only.
      
      This introduces a problem for integrating glib2 into libvirt
      though, as once integrated, there would be no way to build
      virt-login-shell without an external dependancy on glib2 and
      this is definitely not setuid safe.
      
      To resolve this problem, we split the virt-login-shell binary
      into two parts. The first part is setuid and does almost
      nothing. It simply records the original uid+gid, and then
      invokes the virt-login-shell-helper binary. Crucially when
      it does this it completes scrubs all environment variables.
      It is thus safe for virt-login-shell-helper to link to the
      normal libvirt.so. Any things that constructor functions
      do cannot be influenced by user control env vars or cli
      args.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      4feeb2d9
  5. 03 6月, 2019 2 次提交
  6. 12 4月, 2019 1 次提交
    • D
      tests: add targets for building libvirt inside Docker containers · 89f8902a
      Daniel P. Berrangé 提交于
      The Travis CI system uses Docker containers for its build environment.
      These are pre-built and hosted under quay.io/libvirt so that developers
      can use them for reproducing problems locally.
      
      Getting the right Docker command syntax to use them, however, is not
      entirely easy. This patch addresses that usability issue by introducing
      some make targets. To run a simple build (aka 'make all') using the
      Fedora 28 container:
      
         make ci-build@fedora-28
      
      To also run unit tests
      
         make ci-check@fedora-28
      
      This is just syntax sugar for calling the previous command with a
      custom make target
      
         make ci-build@fedora-28 CI_MAKE_ARGS="check"
      
      To do a purely interactive build it is possible to request a shell
      
         make ci-shell@fedora-28
      
      To do a MinGW build, it is currently possible to use the fedora-rawhide
      image and request a different configure script
      
         make ci-build@fedora-rawhide CI_CONFIGURE=mingw32-configure
      
      It is also possible to do cross compiled builds via the Debian containers
      
         make ci-build@debian-9-cross-s390x
      
      In all cases the GIT source tree is cloned locally into a 'ci-tree/src'
      sub-directory which is then exposed to the container at '/src'. It is
      setup to use a separate build directory so the build takes place in a
      subdir '/src/build'. A source tree build can be requested instead
      by passing an empty string CI_VPATH= arg to make.
      
      The make rules are kept in a standalone file that is included into the
      main Makefile.am, so that it is possible to run them without having to
      invoke autotools first.
      
      It is neccessary to disable the gnulib submodule commit check because
      this fails due to the way we have manually cloned submodule repos as
      primary git repos with their own .git directory, instead of letting
      git treat them as submodules in the top level .git directory.
      
        make[1]: Entering directory '/src/build'
        fatal: Not a valid object name origin
        fatal: run_command returned non-zero status for .gnulib
        .
        maint.mk: found non-public submodule commit
        make: *** [/src/maint.mk:1448: public-submodule-commit] Error 1
      Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      89f8902a
  7. 05 4月, 2019 1 次提交
    • C
      docs: Remove search.php and all references · fb0d6049
      Cole Robinson 提交于
      libvirt.org/search.php drops into some kind of screen which I guess
      is supposed to show a search bar with options, but presently for me
      renders as nothing but the following text:
      
      Search the documentation on Libvirt.org
      
      The search service indexes the libvirt APIs and documentation as well as the libvir-list@redhat.com mailing-list archives. To use it simply provide a set of keywords:
      
      The main page search bar now redirects to google, this page is broken,
      I say we just remove it and move on.
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NCole Robinson <crobinso@redhat.com>
      fb0d6049
  8. 03 4月, 2019 1 次提交
    • A
      maint: Stop generating ChangeLog from git · ce97c33a
      Andrea Bolognani 提交于
      Our ChangeLog is generated by basically redirecting the output
      of 'git log' into it so, as can be expected, it has only gotten
      bigger as development has progressed. As of today, its size has
      reached pretty much comical levels:
      
        $ du -sk ChangeLog
        11328 ChangeLog
      
      All of that for information *literally nobody* cares about: end
      users and distro maintainers have proper release notes lovingly
      compiled for them, while developers peruse the history either by
      calling 'git log' directly or through their favorite $EDITOR's
      git integration.
      
      Replacing the generated ChangeLog with a short message pointing
      interested parties to the git repository does not only reduce
      the size of the unpacked sources from 259904 KiB to 248576 KiB
      (~4% saving): from a quick test on my laptop, doing so reduces
      the size of the *compressed* release archive from 15140 KiB to
      12364 KiB (~18% saving) and also takes the time needed to run
      'make distcheck' down from 4:44 to 4:21 (~8% saving).
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      ce97c33a
  9. 16 3月, 2019 1 次提交
  10. 12 2月, 2019 1 次提交
    • M
      tools: Keep wireshark plugin registration code in git · a87a75e5
      Michal Privoznik 提交于
      In order to be able to dissect libvirt protocol the wireshark
      plugin needs to be registered. So far this plugin registration
      code was generated on every build using a script that was copied
      over from wireshark's tools/ directory.
      
      This is suboptimal, because the way that plugins register changes
      across wireshark releases. Therefore, let's keep the generated
      file in the git, put the command line used to generate the file
      into a comment and remove the script.
      
      This solution allows us to put different registration mechanism
      into one file (under #ifdef-s) and thus compile with wider range
      of wireshark releases.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      a87a75e5
  11. 19 4月, 2018 2 次提交
    • D
      po: minimize & canonicalize translations stored in git · a3857dbe
      Daniel P. Berrangé 提交于
      Similar to the libvirt.pot, .po files contain line numbers and file
      names identifying where in the source a translatable string comes from.
      The source locations in the .po files are thrown away and replaced with
      content from the libvirt.pot whenever msgmerge is run, so this is not
      precious information that needs to be stored in git.
      
      When msgmerge processes a .po file, it will add in any msgids from the
      libvirt.pot that were not already present. Thus, if a particular msgid
      currently has no translation, it can be considered redundant and again
      does not need storing in git.
      
      When msgmerge processes a .po file and can't find an exact existing
      translation match, it will try todo fuzzy matching instead, marking such
      entries with a "# fuzzy" comment to alert the translator to take a
      look and either discard, edit or accept the match. Looking at the
      existing fuzzy matches in .po files shows that the quality is awful,
      with many having a completely different set of printf format specifiers
      between the msgid and fuzzy msgstr entry. Fortunately when msgfmt
      generates the .gmo, the fuzzy entries are all ignored anyway. The fuzzy
      entries could be useful to translators if they were working on the .po
      files directly from git, but Libvirt outsourced translation to the
      Fedora Zanata system, so keeping fuzzy matches in git is not much help.
      
      Finally, by default msgids are sorted based on source location. Thus, if
      a bit of code with translatable text is moved from one file to another,
      it may shift around in the .po file, despite the msgid not itself changing.
      If the msgids were sorted alphabetically, the .po files would have
      stable ordering when code is refactored.
      
      This patch takes advantage of the above observations to canonicalize
      and minimize the content stored for .po files in git. Instead of storing
      the real .po files, we now store .mini.po files.
      
      The .mini.po files are the same file format as .po files, but have no
      source location comments, are sorted alphabetically, and all fuzzy
      msgstrs and msgids with no translation are discarded. This cuts the size
      of content in the po directory from 109MB to 19MB.
      
      Users working from a libvirt git checkout who need the full .po files
      can run "make update-po", which merges the libvirt.pot and .mini.po
      file to create a .po file containing all the content previously stored
      in git.
      
      Conversely if a full .po file has been modified, for example, by
      downloading new content from Zanata, the .mini.po files can be updated
      by running "make update-mini-po". The resulting diffs of the .mini.po
      file will clearly show the changed translations without any of the noise
      that previously obscured content. Being able to see content changes
      clearly actually identified a bug in the zanata python client where it
      was adding bogus "fuzzy" annotations to many messages:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=1564497
      
      Users working from libvirt releases should not see any difference in
      behaviour, since the tarballs only contain the full .po files, not the
      .mini.po files.
      
      As an added benefit, generating tarballs with "make dist", will no
      longer cause creation of dirty files in git, since it won't touch the
      .mini.po files, only the .po files which are no longer kept in git.
      
      To avoid creating a single commit 100+MB in size, each language is
      minimized separately in a following commit.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      a3857dbe
    • D
      po: provide custom make rules for po file management · c0a8ea45
      Daniel P. Berrangé 提交于
      Historically we have relied on autopoint/gettextize to install a
      standard po/Makefile.in.in. There is very limited scope for customizing
      this and it also causes a bunch of extra stuff to be pulled into
      configure.ac which potentially clashes with gnulib. Writing make rules
      for po file management is no more difficult than any other rules libvirt
      has, so stop using autopoint/gettextize.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      c0a8ea45
  12. 14 3月, 2018 1 次提交
  13. 22 2月, 2018 5 次提交
  14. 31 1月, 2018 1 次提交
  15. 09 5月, 2017 2 次提交
    • A
      Add YouCompleteMe support · 64b474a8
      Andrea Bolognani 提交于
      YouCompleteMe[1] is a vim plugin that implements semantic
      code completion using libclang.
      
      For non-trivial projects such as libvirt, the plugin needs
      some help figuring out where to find the various header
      files: generate its configuration file at configure time
      so that the plugin works out of the box.
      
      [1] http://valloric.github.io/YouCompleteMe/
      64b474a8
    • A
      Add color_coded support · a50dee9f
      Andrea Bolognani 提交于
      color_coded[1] is a vim plugin that implements semantic
      syntax highlighting using libclang.
      
      For non-trivial projects such as libvirt, the plugin needs
      some help figuring out where to find the various header
      files: generate its configuration file at configure time
      so that the plugin works out of the box.
      
      [1] https://github.com/jeaye/color_coded
      a50dee9f
  16. 26 4月, 2017 2 次提交
  17. 07 4月, 2017 1 次提交