1. 15 11月, 2014 1 次提交
  2. 29 10月, 2014 1 次提交
    • E
      maint: avoid static zero init in tools · 05853324
      Eric Blake 提交于
      C guarantees that static variables are zero-initialized.  Some older
      compilers (and also gcc -fno-zero-initialized-in-bss) create larger
      binaries if you explicitly zero-initialize a static variable.
      
      * tools/virsh-console.c (got_signal): Drop unused variable.
      * tools/virsh-domain.c: Fix initialization.
      * tools/virsh.c: Likewise.
      * tools/virt-host-validate-common.c (virHostMsgWantEscape):
      Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      05853324
  3. 25 3月, 2014 1 次提交
  4. 18 3月, 2014 1 次提交
  5. 10 3月, 2014 1 次提交
    • R
      Fix locking in virsh console · 356bf55e
      Roman Bogorodskiy 提交于
      vshRunConsole() uses virCondWait() which is a wrapper around
      pthread_cond_wait(). On FreeBSD, pthread_cond_wait needs mutex to be
      locked, otherwise it immediately fails with EPERM. On Linux, the
      behaviour in this case is undefined.
      
      So lock the mutex before calling virCondWait().
      356bf55e
  6. 03 9月, 2013 3 次提交
  7. 10 7月, 2013 1 次提交
  8. 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
  9. 08 2月, 2013 1 次提交
  10. 21 12月, 2012 5 次提交
  11. 02 11月, 2012 1 次提交
  12. 21 9月, 2012 1 次提交
  13. 06 9月, 2012 1 次提交
    • 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
  14. 03 8月, 2012 1 次提交
  15. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  16. 02 6月, 2012 1 次提交
    • M
      virsh: Allow users to reedit rejected XML · a7de0523
      Michal Privoznik 提交于
      If users *-edit but make a mistake in XML all changes are
      permanently lost. However, if virsh is not running within
      a script we can ask user if he wants to re-edit the file
      and correct the mistakes.
      a7de0523
  17. 03 4月, 2012 1 次提交
    • M
      virsh: Clarify escape sequence · 7960ce84
      Michal Privoznik 提交于
      Currently, we put no strains on escape sequence possibly leaving users
      with console that cannot be terminated. However, not all ASCII
      characters can be used as escape sequence. Only those falling in
      @ - _ can be; implement and document this constraint.
      7960ce84
  18. 27 2月, 2012 1 次提交
    • P
      virsh: add support for VIR_DOMAIN_CONSOLE_* flags · afa4336e
      Peter Krempa 提交于
      This patch adds support for the newly introduced
      VIR_DOMAIN_CONSOLE_FORCE and VIR_DOMAIN_CONSOLE_SAFE flags. The console
      command now has an optional parameter --force that specifies that the
      user wants to forcibly interrupt an ongoing console session and create
      a new one. Flag --safe requests that the console should be opened only
      if the hypervisor driver supports safe console handling.
      
      The behaviour to this point was that the daemon opened two streams to
      the console, that competed for data from the pipe, and the result was
      that both of the consoles ended up scrambled.
      
      This patch doesn't modify operation of other commands dealing with
      console connections (start, create) as those open connections to newly
      started domains making it virtually impossible for another client to race
      for the console and steal it.
      
      * tools/console.c:
              - add support for flag passthrough
      * tools/console.h:
              - modify function prototypes to match impl.
      * tools/virsh.c:
              - add flag --force for the console command
      afa4336e
  19. 21 12月, 2011 1 次提交
  20. 01 12月, 2011 1 次提交
  21. 24 11月, 2011 1 次提交
    • J
      virsh: Always run event loop · fd7e85ac
      Jiri Denemark 提交于
      Since virsh already implements event loop, it has to also run it. So far
      the event loop was only running during virsh console command.
      fd7e85ac
  22. 16 9月, 2011 1 次提交
  23. 17 8月, 2011 1 次提交
  24. 10 8月, 2011 1 次提交
  25. 22 7月, 2011 1 次提交
    • E
      build: rename files.h to virfile.h · 8e22e089
      Eric Blake 提交于
      In preparation for a future patch adding new virFile APIs.
      
      * src/util/files.h, src/util/files.c: Move...
      * src/util/virfile.h, src/util/virfile.c: ...here, and rename
      functions to virFile prefix.  Macro names are intentionally
      left alone.
      * *.c: All '#include "files.h"' uses changed.
      * src/Makefile.am (UTIL_SOURCES): Reflect rename.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_close): Likewise.
      * src/libvirt_private.syms: Likewise.
      * docs/hacking.html.in: Likewise.
      * HACKING: Regenerate.
      8e22e089
  26. 21 6月, 2011 1 次提交
    • C
      Promote virEvent*Handle/Timeout to public API · 6094ad7b
      Cole Robinson 提交于
      Since we virEventRegisterDefaultImpl is now a public API, callers need
      a way to invoke the default registered Handle and Timeout functions. We
      already have general functions for these internally, so promote
      them to the public API.
      
      v2:
          Actually add APIs to libvirt.h
      6094ad7b
  27. 14 3月, 2011 1 次提交
    • O
      virsh: Free stream when shutdown console · abfa97a2
      Osier Yang 提交于
      Otherwise connection of hypervisor driver will be leaked when
      one shutdown the guest in console. e.g.
      
      [root@localhost]# init 0
      ......
      init: Re-executing /sbin/init
      Halting system...
      Power down.
      
      error: Failed to disconnect from the hypervisor, 1 leaked reference(s)
      abfa97a2
  28. 07 3月, 2011 3 次提交
    • D
      Expose event loop implementation as a public API · 2ed6cc7b
      Daniel P. Berrange 提交于
      Not all applications have an existing event loop they need
      to integrate with. Forcing them to implement the libvirt
      event loop integration APIs is an undue burden. This just
      exposes our simple poll() based implementation for apps
      to use. So instead of calling
      
         virEventRegister(....callbacks...)
      
      The app would call
      
         virEventRegisterDefaultImpl()
      
      And then have a thread somewhere calling
      
          static bool quit = false;
          ....
          while (!quit)
            virEventRunDefaultImpl()
      
      * daemon/libvirtd.c, tools/console.c,
        tools/virsh.c: Convert to public event loop APIs
      * include/libvirt/libvirt.h.in, src/libvirt_private.syms: Add
        virEventRegisterDefaultImpl and virEventRunDefaultImpl
      * src/util/event.c: Implement virEventRegisterDefaultImpl
        and virEventRunDefaultImpl using poll() event loop
      * src/util/event_poll.c: Add full error reporting
      * src/util/virterror.c, include/libvirt/virterror.h: Add
        VIR_FROM_EVENTS
      2ed6cc7b
    • D
      Move event code out of the daemon/ into src/util/ · 343eaa15
      Daniel P. Berrange 提交于
      The event loop implementation is used by more than just the
      daemon, so move it into the shared area.
      
      * daemon/event.c, src/util/event_poll.c: Renamed
      * daemon/event.h, src/util/event_poll.h: Renamed
      * tools/Makefile.am, tools/console.c, tools/virsh.c: Update
        to use new virEventPoll APIs
      * daemon/mdns.c, daemon/mdns.c, daemon/Makefile.am: Update
        to use new virEventPoll APIs
      343eaa15
    • D
      Convert daemon/virsh over to use primary event APIs, rather than impl · 5d2c045c
      Daniel P. Berrange 提交于
      The daemon code calls virEventAddHandleImpl directly instead
      of calling the wrapper virEventAddHandle.
      
      * tools/console.c, daemon/libvirtd.c, daemon/mdns.c: Convert to
        use primary event APIs
      5d2c045c
  29. 24 2月, 2011 1 次提交
  30. 10 12月, 2010 1 次提交
  31. 12 11月, 2010 2 次提交
    • D
      Fix reference counting bug in virsh console · a9261567
      Daniel P. Berrange 提交于
      The event watches need to be removed before the event loop
      terminates, otherwise they cause a dangling reference to
      be held on the virStreamPtr, which in turns holds a reference
      on virConnectPtr, which in turn causes errors like
      
        "Failed to disconnect from the hypervisor"
      
      * tools/console.c: Remove watches before event loop quits
      * tools/virsh.c: Print out dangling reference count
      a9261567
    • D
      Re-write virsh console to use streams · dad4b5d4
      Daniel P. Berrange 提交于
      This re-writes the 'virsh console' command so that it uses
      the new streams API. This lets it run remotely and/or as a
      non-root user. This requires that virsh be linked against
      the simple event loop from libvirtd in daemon/event.c
      As an added bonus, it can now connect to any console device,
      not just the first one.
      
      * tools/Makefile.am: Link to event.c
      * tools/console.c, tools/console.h: Rewrite to use the
        virDomainOpenConsole() APIs with streams
      * tools/virsh.c: Support choosing the console name
        via --devname $NAME
      dad4b5d4