1. 23 1月, 2013 1 次提交
  2. 18 1月, 2013 1 次提交
  3. 17 1月, 2013 1 次提交
  4. 16 1月, 2013 1 次提交
  5. 14 1月, 2013 2 次提交
    • D
      Introduce an LXC specific public API & library · 3d1596b0
      Daniel P. Berrange 提交于
      This patch introduces support for LXC specific public APIs. In
      common with what was done for QEMU, this creates a libvirt_lxc.so
      library and libvirt/libvirt-lxc.h header file.
      
      The actual APIs are
      
        int virDomainLxcOpenNamespace(virDomainPtr domain,
                                      int **fdlist,
                                      unsigned int flags);
      
        int virDomainLxcEnterNamespace(virDomainPtr domain,
                                       unsigned int nfdlist,
                                       int *fdlist,
                                       unsigned int *noldfdlist,
                                       int **oldfdlist,
                                       unsigned int flags);
      
      which provide a way to use the setns() system call to move the
      calling process into the container's namespace. It is not
      practical to write in a generically applicable manner. The
      nearest that we could get to such an API would be an API which
      allows to pass a command + argv to be executed inside a
      container. Even if we had such a generic API, this LXC specific
      API is still useful, because it allows the caller to maintain
      the current process context, in particular any I/O streams they
      have open.
      
      NB the virDomainLxcEnterNamespace() API is special in that it
      runs client side, so does not involve the internal driver API.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      3d1596b0
    • D
      Convert HAVE_UDEV to WITH_UDEV · d3b05abf
      Daniel P. Berrange 提交于
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d3b05abf
  6. 21 12月, 2012 9 次提交
  7. 13 12月, 2012 2 次提交
    • J
      virsh: use vshReconnect for non-default connections too · 8d0e7eb4
      Ján Tomko 提交于
      For non-default connections (specified by the environment variable or
      the command line option) we call virConnectOpenAuth without registering
      the vshCatchDisconnect callback.
      
      This calls vshReconnect instead which takes care of it.
      8d0e7eb4
    • J
      virsh: don't lie about reconnection in vshReconnect · d94b501b
      Ján Tomko 提交于
      Since we (ab)use vshReconnect for the default URI connection, if it
      fails it might print 'Failed to reconnect to the hypervisor' even if we
      were never connected before.
      
      This changes it to only mention reconnection on the first try after
      getting disconnected.
      d94b501b
  8. 07 12月, 2012 1 次提交
    • P
      virsh: Fix usage of header termios.h · 989a427d
      Peter Krempa 提交于
      The termios struct exported by the termios.h header is used as an
      argument for vshMakeStdinRaw(). The header isn't used anywhere in
      tools/virsh-domain.c.
      
      This patch adds the header to the header declaring vshMakeStdinRaw() and
      removes other places in virsh.
      989a427d
  9. 03 12月, 2012 1 次提交
    • P
      virsh: Report errors if arguments of the schedinfo command are incorrect · bf720959
      Peter Krempa 提交于
      Libvirt's helper API's when called directly don't raise the error so
      that virsh remembers it. Subsequent calls to libvirt API's might reset
      the error.
      
      In case of schedinfo virDomainFree() in the cleanup section resets the
      error when virTypedParameterAssignFromStr() fails.
      
      This patch adds function vshSaveLibvirtError() that can be called after
      calling libvirt helper APIs to ensure the error is remembered.
      bf720959
  10. 30 11月, 2012 1 次提交
  11. 08 11月, 2012 1 次提交
    • E
      virsh: make ,, escape parsing common · 9d91a18e
      Eric Blake 提交于
      So far, none of the existing callers of vshStringToArray expected
      the user to ever pass a literal comma; meanwhile, snapshot parsing
      had rolled its own array parser.  Moving the comma escaping into
      the common function won't affect any existing callers, and will make
      this function reusable for adding memory handling to snapshot parsing.
      
      As a bonus, the testsuite was already testing snapshot parsing, so
      the fact that the test still passes means that we are now giving
      testsuite exposure to vshStringToArray.
      
      * tools/virsh-snapshot.c (vshParseSnapshotDiskspec): Move ,,
      parsing...
      * tools/virsh.c (vshStringToArray): ...into common function.
      Also, vshStrdup can't fail.
      9d91a18e
  12. 02 11月, 2012 1 次提交
  13. 01 11月, 2012 1 次提交
    • E
      build: prefer mkostemp for multi-thread safety · 4dbd6e96
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=871756
      
      Commit cd1e8d1c assumed that systems new enough to have journald
      also have mkostemp; but this is not true for uclibc.
      
      For that matter, use of mkstemp[s] is unsafe in a multi-threaded
      program.  We should prefer mkostemp[s] in the first place.
      
      * bootstrap.conf (gnulib_modules): Add mkostemp, mkostemps; drop
      mkstemp and mkstemps.
      * cfg.mk (sc_prohibit_mkstemp): New syntax check.
      * tools/virsh.c (vshEditWriteToTempFile): Adjust caller.
      * src/qemu/qemu_driver.c (qemuDomainScreenshot)
      (qemudDomainMemoryPeek): Likewise.
      * src/secret/secret_driver.c (replaceFile): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainScreenshot): Likewise.
      4dbd6e96
  14. 09 10月, 2012 1 次提交
    • D
      interface: add udev based backend for virInterface · 5a33366f
      Doug Goldstein 提交于
      Add a read-only udev based backend for virInterface. Useful for distros
      that do not have netcf support yet. Multiple libvirt based utilities use
      a HAL based fallback when virInterface is not available which is less
      than ideal. This implements:
      * virConnectNumOfInterfaces()
      * virConnectListInterfaces()
      * virConnectNumOfDefinedInterfaces()
      * virConnectListDefinedInterfaces()
      * virConnectListAllInterfaces()
      * virConnectInterfaceLookupByName()
      * virConnectInterfaceLookupByMACString()
      5a33366f
  15. 21 9月, 2012 1 次提交
  16. 20 9月, 2012 1 次提交
  17. 19 9月, 2012 2 次提交
    • D
      build: define WITH_INTERFACE for the driver · b95ad92e
      Doug Goldstein 提交于
      Based exclusively on work by Eric Blake in a patch posted with the same
      subject. However some modifications related to comments and my plans to
      add another backend.
      
      Added WITH_INTERFACE as the only automake variable deciding whether to
      build the driver and using WITH_NETCF to identify that we're wanting to
      use the netcf library as the backend.
      
      * configure.ac: Added with_interface
      * src/interface/netcf_driver.c: Renamed..
      * src/interface/interface_backend_netcf.c: ..to this to match storage.
      * src/interface/netcf_driver.h: Renamed..
      * src/interface/interface_driver.h: ..to this.
      * daemon/Makefile.am: Respect WITH_INTERFACE and WITH_NETCF.
      * libvirt.spec.in: Add RPM support for --with-interface
      b95ad92e
    • D
      virsh: Rename QEmu to QEMU to match upstream · c88a4f2a
      Doug Goldstein 提交于
      Match upstream's naming of QEMU. There was a notice on the ML that said
      the preferred spelling was QEMU a while back.
      c88a4f2a
  18. 17 9月, 2012 1 次提交
    • O
      virsh: Don't motify the const string · f5fb059a
      Osier Yang 提交于
      This improve helper vshStringToArray to accept const string as
      argument instead. To not convert the const string when using
      vshStringToArray, and thus avoid motifying it.
      f5fb059a
  19. 06 9月, 2012 2 次提交
    • O
      list: Add helper to convert strings separated by ', ' to array · f7eac4f7
      Osier Yang 提交于
      tools/virsh.c: New helper function vshStringToArray.
      tools/virsh.h: Declare vshStringToArray.
      tools/virsh-domain.c: use the helper in cmdUndefine.
      f7eac4f7
    • E
      build: use re-entrant functions in virsh · 44342a0e
      Eric Blake 提交于
      Yesterday's commit 15d2c9fa pointed out that virsh was still using
      localtime(), which is not thread-safe, even though virsh is
      definitely multi-threaded.  Even if we only ever triggered it from
      one thread, it's better safe than sorry for maintenance purposes.
      
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_nonreentrant):
      Tighten the rule.
      * tools/virsh.c (vshOutputLogFile): Avoid localtime.
      (vshEditWriteToTempFile, vshEditReadBackFile, cmdCd, cmdPwd)
      (vshCloseLogFile): Avoid strerror.
      * tools/console.c (vshMakeStdinRaw): Likewise.
      * tools/virsh-domain.c (vshGenFileName): Fix spacing in previous
      patch.
      44342a0e
  20. 05 9月, 2012 1 次提交
    • P
      Pass a correct pointer type to localtime_r(3). · 15d2c9fa
      Paul Eggert 提交于
      On 09/04/2012 08:20 AM, Eric Blake wrote:
      > tv_sec is required by POSIX to be
      > of type time_t; so this is a bug in the OpenBSD header
      > [for declaring it as long]
      
      Most likely this problem arose because of the patch I pushed
      in gnulib commit e07d7c40f3ca5ec410cf5aa6fa03cfe51e712039.
      Previously, gnulib required timeval's tv_sec to be
      the same size as time_t.  But now, it requires only that
      tv_sec be big enough to hold a time_t.
      
      This patch was needed for Emacs.  Without the patch, gnulib
      replaced struct timeval on OpenBSD, and this messed up
      utimens.c, and Emacs wouldn't build.
      
      Alternatively, gnulib could substitute its own struct timeval
      for the system's, wrapping every struct timeval-using function
      (gettimeofday, futimesat, futimes, lutimes, etc.  That'd be
      more work, though.  And it would introduce some performance
      issues with gettimeofday, which is supposed to be fast.
      
      I've been trying to get away from using struct timeval,
      and to use the higher-resolution struct timespec instead,
      so messing with these obsolescent interfaces has been
      lower priority for me.  But if someone wants to take the
      more-ambitious approach that'd be fine, I expect.
      
      For this particular case, though, how about if we avoid
      the problem entirely?  libvirt doesn't need to use struct
      timeval here at all.  It makes libvirt smaller and probably
      faster, and it ports to OpenBSD without messing with gnulib.
      15d2c9fa
  21. 31 8月, 2012 3 次提交
  22. 21 8月, 2012 5 次提交
    • E
      virsh: split out virsh-volume.c · f95f1ba4
      Eric Blake 提交于
      Last of the file splits.
      
      * tools/virsh-volume.h: New file.
      * tools/Makefile.am (virsh_SOURCES): Build it.
      * tools/virsh.c: Use new header.
      * tools/virsh-volume.c: Likewise.
      (vshCommandOptVolBy): Fix flag usage.
      f95f1ba4
    • E
      virsh: split out virsh-snapshot.c · c0dbd5f3
      Eric Blake 提交于
      Almost done with the splits.
      
      * tools/virsh-snapshot.h: New file.
      * tools/Makefile.am (virsh_SOURCES): Build it.
      * tools/virsh.c: Use new header.
      * tools/virsh-snapshot.c: Likewise.
      c0dbd5f3
    • E
      virsh: split out virsh-secret.c · 9cbb0eda
      Eric Blake 提交于
      One of the simpler splits.
      
      * tools/virsh-secret.h: New file.
      * tools/Makefile.am (virsh_SOURCES): Build it.
      * tools/virsh.c: Use new header.
      * tools/virsh-secret.c: Likewise.
      9cbb0eda
    • E
      virsh: split out virsh-pool.c · ef8d3583
      Eric Blake 提交于
      More in a series of file splits.
      
      * tools/virsh-pool.h: New file.
      * tools/Makefile.am (virsh_SOURCES): Build it.
      * tools/virsh.c: Use new header.
      * tools/virsh-pool.c: Likewise.
      (virCommandOptPoolBy): Fix flag usage.
      ef8d3583
    • E
      virsh: split out virsh-nwfilter.c · 69af4f7c
      Eric Blake 提交于
      Yet another split file.
      
      * tools/virsh-nwfilter.h: New file.
      * tools/Makefile.am (virsh_SOURCES): Build it.
      * tools/virsh.c: Use new header.
      * tools/virsh-nwfilter.c: Likewise.
      69af4f7c