1. 23 10月, 2013 1 次提交
    • M
      python: Fix Create*WithFiles filefd passing · 713a4f4b
      Marian Neagul 提交于
      Commit d76227be added functions virDomainCreateWithFiles and
      virDomainCreateXMLWithFiles, but there was a little piece missing in
      python bindings.  This patch fixes proper passing of file descriptors
      in the overwrites of these functions.
      713a4f4b
  2. 21 10月, 2013 1 次提交
    • D
      Don't link virt-login-shell against libvirt.so (CVE-2013-4400) · 31a3086d
      Daniel P. Berrange 提交于
      The libvirt.so library has far too many library deps to allow
      linking against it from setuid programs. Those libraries can
      do stuff in __attribute__((constructor) functions which is
      not setuid safe.
      
      The virt-login-shell needs to link directly against individual
      files that it uses, with all library deps turned off except
      for libxml2 and libselinux.
      
      Create a libvirt-setuid-rpc-client.la library which is linked
      to by virt-login-shell. A config-post.h file allows this library
      to disable all external deps except libselinux and libxml2.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 3e2f27e1)
      31a3086d
  3. 29 8月, 2013 1 次提交
  4. 23 8月, 2013 2 次提交
  5. 22 8月, 2013 1 次提交
  6. 30 7月, 2013 1 次提交
    • D
      Delete obsolete / unused python test files · 5bb2a245
      Daniel P. Berrange 提交于
      The python/tests directory contains a number of so called
      "tests" for the python API. These are all hardcoded to
      look for Xen and cannot be run in any automated fashion,
      and no one is ever manually running them. Given that they
      don't meaningully contribute to the test coverage, delete
      them.
      
      For some reason these tests were also copied into the
      filesystem as part of 'make install'. The change to the
      RPM in commit 3347a420
      caused a build failure, since it removed the code which
      deleted these installed tests.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      5bb2a245
  7. 29 7月, 2013 1 次提交
    • C
      python: Drop TODO · 3347a420
      Cole Robinson 提交于
      File hasn't been really touched for 7 years. And with recent rawhide
      changes it contributed to an RPM build failure. Let's drop it.
      
      This also removes installation of a libvirt-python doc dir, so drop
      handling of it from the RPM spec.
      3347a420
  8. 19 7月, 2013 1 次提交
    • E
      maint: split long lines in Makefiles · d21d40bf
      Eric Blake 提交于
      Makefiles are another easy file to enforce line limits.
      
      Mostly straightforward; interesting tricks worth noting:
      src/Makefile.am: $(confdir) was already defined, use it in more places
      tests/Makefile.am: path_add and VG required some interesting compression
      
      * cfg.mk (sc_prohibit_long_lines): Add another test.
      * Makefile.am: Fix offenders.
      * daemon/Makefile.am: Likewise.
      * docs/Makefile.am: Likewise.
      * python/Makefile.am: Likewise.
      * src/Makefile.am: Likewise.
      * tests/Makefile.am: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d21d40bf
  9. 18 7月, 2013 2 次提交
    • J
      Add VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event · 4421e257
      Jiri Denemark 提交于
      4421e257
    • D
      Introduce new domain create APIs to pass pre-opened FDs to LXC · d76227be
      Daniel P. Berrange 提交于
      With container based virt, it is useful to be able to pass
      pre-opened file descriptors to the container init process.
      This allows for containers to be auto-activated from incoming
      socket connections, passing the active socket into the container.
      
      To do this, introduce a pair of new APIs, virDomainCreateXMLWithFiles
      and virDomainCreateWithFiles, which accept an array of file
      descriptors. For the LXC driver, UNIX file descriptor passing
      will be used to send them to libvirtd, which will them pass
      them down to libvirt_lxc, which will then pass them to the container
      init process.
      
      This will only be implemented for LXC right now, but the design
      is generic enough it could work with other hypervisors, hence
      I suggest adding this to libvirt.so, rather than libvirt-lxc.so
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d76227be
  10. 15 7月, 2013 1 次提交
    • G
      python: return dictionary without value in case of no blockjob · 0f9e67bf
      Guannan Ren 提交于
      Currently, when there is no blockjob, dom.blockJobInfo('vda')
      still reports error because it doesn't distinguish return value 0 from -1.
      libvirt.libvirtError: virDomainGetBlockJobInfo() failed
      
      virDomainGetBlockJobInfo() API return value:
       -1 in case of failure, 0 when nothing found, 1 found.
      
      And use PyDict_SetItemString instead of PyDict_SetItem when key is
      of string type. PyDict_SetItemString increments key/value reference
      count, so call Py_DECREF() for value. For key, we don't need to
      do this, because PyDict_SetItemString will handle it internally.
      0f9e67bf
  11. 11 7月, 2013 1 次提交
  12. 10 7月, 2013 1 次提交
  13. 25 6月, 2013 2 次提交
    • J
      python: Add bindings for extensible migration APIs · 6f4c6af6
      Jiri Denemark 提交于
      The patch implements wrappers for virDomainMigrate3 and
      virDomainMigrateToURI3.
      6f4c6af6
    • J
      Extensible migration APIs · 4bf62f44
      Jiri Denemark 提交于
      This patch introduces two new APIs virDomainMigrate3 and
      virDomainMigrateToURI3 that may be used in place of their older
      variants. These new APIs take optional migration parameters (such as
      bandwidth, domain XML, ...) in an array of virTypedParameters, which
      makes adding new parameters easier as there's no need to introduce new
      APIs whenever a new migration parameter needs to be added. Both APIs are
      backward compatible and will automatically use older migration calls in
      case the new calls are not supported as long as the typed parameters
      array does not contain any parameter which was not supported by the
      older calls.
      4bf62f44
  14. 28 5月, 2013 1 次提交
    • E
      syntax: prefer space after semicolon in for loop · 146ba114
      Eric Blake 提交于
      I noticed several unusual spacings in for loops, and decided to
      fix them up.  See the next commit for the syntax check that found
      all of these.
      
      * examples/domsuspend/suspend.c (main): Fix spacing.
      * python/libvirt-override.c: Likewise.
      * src/conf/interface_conf.c: Likewise.
      * src/security/virt-aa-helper.c: Likewise.
      * src/util/virconf.c: Likewise.
      * src/util/virhook.c: Likewise.
      * src/util/virlog.c: Likewise.
      * src/util/virsocketaddr.c: Likewise.
      * src/util/virsysinfo.c: Likewise.
      * src/util/viruuid.c: Likewise.
      * src/vbox/vbox_tmpl.c: Likewise.
      * src/xen/xen_hypervisor.c: Likewise.
      * tools/virsh-domain-monitor.c (vshDomainStateToString): Drop
      default case, to let compiler check us.
      * tools/virsh-domain.c (vshDomainVcpuStateToString): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      146ba114
  15. 21 5月, 2013 2 次提交
    • O
      python: Remove the whitespace before ";" · ea4e5540
      Osier Yang 提交于
      ea4e5540
    • E
      maint: use LGPL correctly · d7f53c7b
      Eric Blake 提交于
      Several files called out COPYING or COPYING.LIB instead of using
      the normal boilerplate.  It's especially important that we don't
      call out COPYING from an LGPL file, since COPYING is traditionally
      used for the GPL.  A few files were lacking copyright altogether.
      
      * src/rpc/gendispatch.pl: Add missing copyright.
      * Makefile.nonreentrant: Likewise.
      * src/check-symfile.pl: Likewise.
      * src/check-symsorting.pl: Likewise.
      * src/driver.h: Likewise.
      * src/internal.h: Likewise.
      * tools/libvirt-guests.sh.in: Likewise.
      * tools/virt-pki-validate.in: Mention copyright in comment, not just code.
      * tools/virt-sanlock-cleanup.in: Likewise.
      * src/rpc/genprotocol.pl: Spell out license terms.
      * src/xen/xend_internal.h: Likewise.
      * src/xen/xend_internal.c: Likewise.
      * Makefile.am: Likewise.
      * daemon/Makefile.am: Likewise.
      * docs/Makefile.am: Likewise.
      * docs/schemas/Makefile.am: Likewise.
      * examples/apparmor/Makefile.am: Likewise.
      * examples/domain-events/events-c/Makefile.am: Likewise.
      * examples/dominfo/Makefile.am: Likewise.
      * examples/domsuspend/Makefile.am: Likewise.
      * examples/hellolibvirt/Makefile.am: Likewise.
      * examples/openauth/Makefile.am: Likewise.
      * examples/python/Makefile.am: Likewise.
      * examples/systemtap/Makefile.am: Likewise.
      * examples/xml/nwfilter/Makefile.am: Likewise.
      * gnulib/lib/Makefile.am: Likewise.
      * gnulib/tests/Makefile.am: Likewise.
      * include/Makefile.am: Likewise.
      * include/libvirt/Makefile.am: Likewise.
      * python/Makefile.am: Likewise.
      * python/tests/Makefile.am: Likewise.
      * src/Makefile.am: Likewise.
      * tests/Makefile.am: Likewise.
      * tools/Makefile.am: Likewise.
      * configure.ac: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d7f53c7b
  16. 10 5月, 2013 1 次提交
  17. 07 5月, 2013 1 次提交
  18. 03 5月, 2013 1 次提交
  19. 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
  20. 20 4月, 2013 1 次提交
    • E
      docs: fix usage of 'onto' · 1bf25ba2
      Eric Blake 提交于
      http://www.uhv.edu/ac/newsletters/writing/grammartip2009.07.01.htm
      (and several other sites) give hints that 'onto' is best used if
      you can also add 'up' just before it and still make sense. In many
      cases in the code base, we really want the two-word form, or even
      a simplification to just 'on' or 'to'.
      
      * docs/hacking.html.in: Use correct 'on to'.
      * python/libvirt-override.c: Likewise.
      * src/lxc/lxc_controller.c: Likewise.
      * src/util/virpci.c: Likewise.
      * daemon/THREADS.txt: Use simpler 'on'.
      * docs/formatdomain.html.in: Better usage.
      * docs/internals/rpc.html.in: Likewise.
      * src/conf/domain_event.c: Likewise.
      * src/rpc/virnetclient.c: Likewise.
      * tests/qemumonitortestutils.c: Likewise.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1bf25ba2
  21. 18 4月, 2013 1 次提交
  22. 26 3月, 2013 1 次提交
    • G
      python: set default value to optional arguments · c65fc29a
      Guannan Ren 提交于
      When prefixing with string (optional) or optional in the description
      of arguments to libvirt C APIs, in python, these arguments will be
      set as optional arugments, for example:
      
       * virDomainSaveFlags:
       * @domain: a domain object
       * @to: path for the output file
       * @dxml: (optional) XML config for adjusting guest xml used on restore
       * @flags: bitwise-OR of virDomainSaveRestoreFlags
      
       the corresponding python APIs is
       restoreFlags(self, frm, dxml=None, flags=0)
      
      The following python APIs are changed to:
       blockCommit(self, disk, base, top, bandwidth=0, flags=0)
       blockPull(self, disk, bandwidth=0, flags=0)
       blockRebase(self, disk, base, bandwidth=0, flags=0)
       migrate(self, dconn, flags=0, dname=None, uri=None, bandwidth=0)
       migrate2(self, dconn, dxml=None, flags=0, dname=None, uri=None, bandwidth=0)
       migrateToURI(self, duri, flags=0, dname=None, bandwidth=0)
       migrateToURI2(self, dconnuri=None, miguri=None, dxml=None, flags=0, \
                     dname=None, bandwidth=0)
       saveFlags(self, to, dxml=None, flags=0)
       migrate(self, domain, flags=0, dname=None, uri=None, bandwidth=0)
       migrate2(self, domain, dxml=None, flags=0, dname=None, uri=None, bandwidth=0)
       restoreFlags(self, frm, dxml=None, flags=0)
      c65fc29a
  23. 22 3月, 2013 3 次提交
  24. 21 3月, 2013 2 次提交
    • P
      python: Fix emulatorpin API bindings · d395c811
      Peter Krempa 提交于
      The addition of emulator pinning APIs didn't think of doing the right
      job with python APIs for them. The default generator produced unusable
      code for this.
      
      This patch switches to proper code as in the case of domain Vcpu pining.
      This change can be classified as a python API-breaker but in the state
      the code was before I doubt anyone was able to use it successfully.
      d395c811
    • G
      python: fix bindings that don't raise an exception · 4b143ab2
      Guannan Ren 提交于
      For example:
       >>> dom.memoryStats()
       libvir: QEMU Driver error : Requested operation is not valid:\
               domain is not running
      
      There are six such python API functions like so.
      The root reason is that generator.py script checks the type of return
      value of a python stub function defined in libvirt-api.xml or
      libvirt-override-api.xml to see whether to add the raise clause or not
      in python wrapper code in libvirt.py.
      
      The type of return value is supposed to be C types.
      For those stub functions which return python non-integer data type like
      string, list, tuple, dictionary, the existing type in functions varies
      from each other which leads problem like this.
      
      Currently, in generator.py, it maintains a buggy whitelist for stub functions
      returning a list type. I think it is easy to forget adding new function name
      in the whitelist.
      
      This patch makes the value of type consistent with C type "char *"
      in libvirt-override-api.xml. For python, any of types could be printed
      as string, so I choose "char *" in this case. And the comment in xml
      could explain it when adding new function definition.
      
            <function name='virNodeGetCPUStats' file='python'>
              ...
       -      <return type='virNodeCPUStats' info='...'/>
       +      <return type='char *' info='...'/>
              ...
            </function>
      4b143ab2
  25. 13 3月, 2013 1 次提交
    • D
      Apply security label when entering LXC namespaces · e4e69e89
      Daniel P. Berrange 提交于
      Add a new virDomainLxcEnterSecurityLabel() function as a
      counterpart to virDomainLxcEnterNamespaces(), which can
      change the current calling process to have a new security
      context. This call runs client side, not in libvirtd
      so we can't use the security driver infrastructure.
      
      When entering a namespace, the process spawned from virsh
      will default to running with the security label of virsh.
      The actual desired behaviour is to run with the security
      label of the container most of the time. So this changes
      virsh lxc-enter-namespace command to invoke the
      virDomainLxcEnterSecurityLabel method.
      
      The current behaviour is:
      
      LABEL                             PID TTY          TIME CMD
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 1 pts/0 00:00:00 systemd
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 3 pts/1 00:00:00 sh
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 24 ? 00:00:00 systemd-journal
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 29 ? 00:00:00 dhclient
      staff_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 47 ? 00:00:00 ps
      
      Note the ps command is running as unconfined_t,  After this patch,
      
      The new behaviour is this:
      
      virsh -c lxc:/// lxc-enter-namespace dan -- /bin/ps -eZ
      LABEL                             PID TTY          TIME CMD
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 1 pts/0 00:00:00 systemd
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 3 pts/1 00:00:00 sh
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 24 ? 00:00:00 systemd-journal
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 32 ? 00:00:00 dhclient
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 38 ? 00:00:00 ps
      
      The '--noseclabel' flag can be used to skip security labelling.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      e4e69e89
  26. 01 3月, 2013 2 次提交
  27. 23 2月, 2013 4 次提交
  28. 12 2月, 2013 1 次提交
  29. 08 2月, 2013 1 次提交