1. 21 8月, 2012 6 次提交
    • E
      virsh: split out virsh-nodedev.c · ea3cf921
      Eric Blake 提交于
      Another worthwhile split, needed one more public function.
      
      * tools/virsh-nodedev.h: New file.
      * tools/Makefile.am (virsh_SOURCES): Build it.
      * tools/virsh-nodedev.c: Use new header.
      * tools/virsh.c: Likewise.
      (vshTreePrint): Export.
      * tools/virsh.h (vshTreePrint): Declare.
      ea3cf921
    • E
      virsh: split out virsh-network.c · dcff981a
      Eric Blake 提交于
      Another relatively easy file split.
      
      * tools/virsh-network.h: New file.
      * tools/Makefile.am (virsh_SOURCES): Build it.
      * tools/virsh.c: Use new header.
      * tools/virsh-network.c: Likewise.
      (vshCommandOptNetworkBy): Update signature.
      dcff981a
    • E
      virsh: split out virsh-interface.c · 7aeb16a8
      Eric Blake 提交于
      Another relatively easy split, since helper functions were fixed
      in the previous patch.
      
      * tools/virsh-interface.h: New file.
      * tools/Makefile.am (virsh_SOURCES): Build it.
      * tools/virsh.c: Use new header.
      * tools/virsh-interface.c: Likewise.
      (vshCommandOptInterfaceBy): Check flags.
      7aeb16a8
    • E
      virsh: declare more common functions · 4c10b3c7
      Eric Blake 提交于
      In preparation for splitting virsh-interface.c, I found these
      functions need to be declared in virsh.h, as well as one that
      belongs more properly in virsh-domain.h.  Also, since we
      use the VSH_BY* flags in more than one function, I improved
      how they are used.
      
      * tools/virsh.h (vshNameSorter, vshCmdHasOption): Declare.
      (VSH_BYID): Turn into enum.
      (vshCommandOptDomainBy): Move...
      * tools/virsh-domain.h): ...here.
      * tools/virsh.c: (vshNameSorter): Export.
      (cmd_has_option): Rename...
      (vshCmdHasOption): ...and export.
      (vshCommandOptDomainBy): Move...
      * tools/virsh-domain.c (vshCommandOptDomainBy): ...here, adjust
      signature, and check flags.
      * tools/virsh-network.c (vshCommandOptNetworkBy): Update callers.
      * tools/virsh-nwfilter.c (vshCommandOptNWFilterBy): Likewise.
      * tools/virsh-secret.c (vshCommandOptSecret): Likewise.
      * tools/virsh-domain-monitor.c (includes): Likewise.
      * tools/virsh-host.c (includes): Likewise.
      4c10b3c7
    • E
      virsh: split out virsh-host.c · ae8e89fb
      Eric Blake 提交于
      The splits are getting easier, with fewer cleanups needed in virsh.h.
      
      * tools/virsh-host.h: New file.
      * tools/Makefile.am (virsh_SOURCES): Build it.
      * tools/virsh-host.c: Use new header.
      * tools/virsh.c: Likewise.
      ae8e89fb
    • E
      virsh: split out virsh-domain-monitor.c · 99ae57f8
      Eric Blake 提交于
      Another file worth compiling on its own instead of by .c inclusion.
      
      * tools/virsh-domain-monitor.h: New file.
      * tools/Makefile.am (virsh_SOURCES): Build it.
      * tools/virsh.h (vshGetDomainDescription): Move to correct
      header.
      * tools/virsh-domain-monitor.c: Use new header.
      * tools/virsh.c: Likewise.
      * tools/virsh-domain.c: Likewise.
      99ae57f8
  2. 20 8月, 2012 5 次提交
    • E
      virsh: drop unused headers · 521b7ab7
      Eric Blake 提交于
      The previous commit now trips up 'make syntax-check' due to a useless
      use of <signal.h>.
      
      * tools/virsh.c (includes): Drop useless includes.
      521b7ab7
    • D
      Fix build of virsh on Win32 by moving SA_SIGINFO stub · 6a481798
      Daniel P. Berrange 提交于
      On Win32 SA_SIGINFO is not defined, so virsh.c stub'd it out
      to 0, but recent changes moved the usage out of virsh.c and
      into virsh-domain.c
      6a481798
    • E
      virsh: use common namespacing · e68ee5e7
      Eric Blake 提交于
      Convert the exported items in virsh.h to use a common 'vsh' prefix.
      
      * tools/virsh.h (VIRSH_MAX_XML_FILE): Rename...
      (VSH_MAX_XML_FILE): ...and parenthesize.
      (DIFF_MSEC, CTRL_CLOSE_BRACKET): Delete.
      (vshUsage, vshInit, vshDeinit, vshParseArgv): Remove prototype.
      (editWriteToTempFile, editFile, editReadBackFile, prettyCapacity)
      (virshReportError): Rename...
      (vshEditWriteToTempFile, vshEditFile, vshEditReadBackFile)
      (vshPrettyCapacity, vshReportError): ...into vsh namespace.
      (jobWatchTimeoutFunc): Move to virsh-domain.c.
      * tools/virsh.c (vshCommandRun): Inline former DIFF_MSEC.
      (main): Inline former CTRL_CLOSE_BRACKET.
      (vshUsage, vshInit, vshDeinit, vshParseArgv): Make static.
      (prettyCapacity, virshReportError, editWriteToTempFile, editFile):
      Fix naming, and adjust usage.
      (vshAskReedit, vshCommandRun, vshEventLoop, vshInit): Adjust
      usage.
      * tools/virsh-domain.c (cmdAttachDevice, cmdCPUCompare)
      (cmdCPUBaseline, cmdCreate, cmdDefine, cmdDetachDevice)
      (cmdUpdateDevice, cmdDesc, cmdUndefine, cmdStart, cmdVcpucount)
      (cmdAttachDevice, cmdDomjobinfo): Likewise.
      * tools/virsh-edit.c (do): Likewise.
      * tools/virsh-interface.c (cmdInterfaceDefine): Likewise.
      * tools/virsh-network.c (cmdNetworkCreate, cmdNetworkDefine):
      Likewise.
      * tools/virsh-nodedev.c (cmdNodeDeviceCreate): Likewise.
      * tools/virsh-nwfilter.c (cmdNWFilterDefine): Likewise.
      * tools/virsh-pool.c (cmdPoolCreate, cmdPoolDefine)
      (cmdPoolDiscoverSources, cmdPoolList): Likewise.
      * tools/virsh-secret.c (cmdSecretDefine): Likewise.
      * tools/virsh-snapshot.c (cmdSnapshotCreate, vshSnapshotCreate)
      (vshLookupSnapshot, cmdSnapshotEdit, cmdSnapshotCurrent)
      (vshGetSnapshotParent): Likewise.
      * tools/virsh-volume.c (cmdVolCreate, cmdVolCreateFrom)
      (cmdVolInfo, cmdVolList): Likewise.
      e68ee5e7
    • D
      Make Win32 stub of vshAskReedit non-static · ee7b4e55
      Daniel P. Berrange 提交于
      The main impl of vshAskReedit is non-static, so the Win32
      stub must be the same
      ee7b4e55
    • D
      Fix syntax-check failures wrt virsh · 2a336379
      Daniel P. Berrange 提交于
      * cfg.mk: Whitelist virsh.h instead of virsh.c for strcasecmp check
      * tools/virsh-domain.h, tools/virsh.h: Fix #define indentation
      2a336379
  3. 18 8月, 2012 4 次提交
    • E
      virsh: kill some double underscores · 6d96fab9
      Eric Blake 提交于
      C99 says that __foo naming is reserved for the compiler.  Besides,
      we had several different styles in use; this consolidates things
      to set up the typedefs up front then declare the types with
      consistent naming.
      
      * tools/virsh.h: Use consistent struct naming.
      * tools/virsh.c (_vshCommandParser): Likewise.
      6d96fab9
    • E
      virsh: split out virsh-domain.c · f4a7b87d
      Eric Blake 提交于
      The virsh-domain.c file was pretty self-contained; the only
      entry point was the table of command definitions.  The bulk
      of this patch is making more functions in virsh.c reusable.
      A later patch will clean up poor naming choices.
      
      * tools/Makefile.am (virsh_SOURCES): Build virsh-domain.c.
      * tools/virsh-domain.h: New file.
      * tools/virsh.h (virshReportError, vshResetLibvirtError)
      (vshAskReedit, vshStreamSink): Declare.
      * tools/virsh.c: Switch from using .c to .h.
      (virshReportError, vshResetLibvirtError, vshAskReedit)
      (vshStreamSink, prettyCapacity): Export.
      (vshCatchInt): Move...
      * tools/virsh-domain.c: ...into sole user.  Use header.
      f4a7b87d
    • E
      virsh: split out virsh.h · c2e494cc
      Eric Blake 提交于
      Having one .c file include another does not give any compilation
      benefits; move towards modular .o files by first splitting out
      reused declarations into a new virsh.h.  This patch doesn't try
      very hard to see which functions are used or not, to make it
      easier to review the file split.  Future patches can further trim
      the header to be smaller.
      
      * tools/Makefile.am (virsh_SOURCES): List new file, and prepare
      for others.
      * tools/virsh.c: Split declarations...
      * tools/virsh.h: ...into new file, and make several functions
      non-static.
      * tools/virsh-domain-monitor.c (vshGetDomainDescription): Make
      non-static.
      c2e494cc
    • E
      virsh: move vshWatchJob earlier · 8e8809e1
      Eric Blake 提交于
      It's easier to order things in topological order than it is to
      forward declare in one file for use only by one other file.
      
      * tools/virsh.c (vshWatchJob, parseRateStr)
      (vshDomainStateToString, vshDomainStateReasonToString)
      (vshDomainControlStateToString, vshDomainVcpuStateToString): Drop
      useless prototypes.
      * tools/virsh-domain.c (vshWatchJob): Move earlier.
      8e8809e1
  4. 16 8月, 2012 1 次提交
  5. 15 8月, 2012 1 次提交
  6. 14 8月, 2012 5 次提交
    • O
      Destroy virdomainlist.[ch] · bb705e25
      Osier Yang 提交于
      As the consensus in:
      https://www.redhat.com/archives/libvir-list/2012-July/msg01692.html,
      this patch is to destroy conf/virdomainlist.[ch], folding the
      helpers into conf/domain_conf.[ch].
      
      * src/Makefile.am:
        - Various indention fixes incidentally
        - Add macro DATATYPES_SOURCES (datatypes.[ch])
        - Link datatypes.[ch] for libvirt_lxc
      
      * src/conf/domain_conf.c:
        - Move all the stuffs from virdomainlist.c into it
        - Use virUnrefDomain and virUnrefDomainSnapshot instead of
          virDomainFree and virDomainSnapshotFree, which are defined
          in libvirt.c, and we don't want to link to it.
        - Remove "if" before "free" the object, as virObjectUnref
          is in the list "useless_free_options".
      
      * src/conf/domain_conf.h:
        - Move all the stuffs from virdomainlist.h into it
        - s/LIST_FILTER/LIST_DOMAINS_FILTER/
      
      * src/libxl/libxl_driver.c:
        - s/LIST_FILTER/LIST_DOMAINS_FILTER/
        - no (include "virdomainlist.h")
      
      * src/libxl/libxl_driver.c: Likewise
      
      * src/lxc/lxc_driver.c: Likewise
      
      * src/openvz/openvz_driver.c: Likewise
      
      * src/parallels/parallels_driver.c: Likewise
      
      * src/qemu/qemu_driver.c: Likewise
      
      * src/test/test_driver.c: Likewise
      
      * src/uml/uml_driver.c: Likewise
      
      * src/vbox/vbox_tmpl.c: Likewise
      
      * src/vmware/vmware_driver.c: Likewise
      
      * tools/virsh-domain-monitor.c: Likewise
      
      * tools/virsh.c: Likewise
      bb705e25
    • J
      virsh: say save-image-edit failed only when it does · 863399f0
      Ján Tomko 提交于
      The common code for editing files in virsh-edit.c expects EDIT_DEFINE to
      return 0 on failure. virDomainSaveImageDefineXML returns 0 on success.
      863399f0
    • C
      virsh: make 'help' command ignore spurious options · 86157b59
      Cole Robinson 提交于
      Similar to the previous patch, prepending 'help' to a partial
      command string doesn't cut us any slack.
      
      $ virsh help pool-define-as --name foo --type dir
      error: command 'help' doesn't support option --name
      
      This patch adds a few hacks to make 'help' ignore everything after the
      first data bit, so the above command shows help output for pool-define-as.
      86157b59
    • C
      virsh: Convert '<cmd> --help' to 'help <cmd>' · d2f97139
      Cole Robinson 提交于
      Often times I find myself halfway through typing a long command when
      I want to see 'help' output. I instinctively append '--help' to the
      command I'm typing, only to get an error:
      
          $ virsh vol-create-as foo --help
          error: command 'vol-create-as' doesn't support option --help
      
      This patch makes --help work in a pretty hacky way. One missing piece
      here is that --help isn't listed as an option in the actual 'help <cmd>'
      output, but maybe this can be a starting point for someone.
      d2f97139
    • C
      virsh.c: Fix compiler warning · e7d1bdfb
      Cole Robinson 提交于
      For some reason I only get this after applying subsequent upcoming
      patches that touch virsh, but don't seem to actually cause the warning.
      
      virsh.c: In function ‘vshCommandParse’:
      virsh.c:2014:46: error: ‘opt_index’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      cc1: all warnings being treated as errors
      e7d1bdfb
  7. 10 8月, 2012 1 次提交
    • M
      docs/virsh: various minor fixes · 4d448b11
      Martin Kletzander 提交于
      List:
       - some old libvir/libvirt rename leftovers (the only problem can be
         if somebody parses 'virsh version' output really badly)
       - remove pointless tags specified in some pages that are not used
      4d448b11
  8. 06 8月, 2012 1 次提交
  9. 03 8月, 2012 2 次提交
  10. 31 7月, 2012 1 次提交
  11. 27 7月, 2012 5 次提交
    • G
      libvirt-guests: systemd host shutdown does not work · 79ca7e4e
      Gerd v. Egidy 提交于
      I originally postet this into the Fedora bugzilla
      https://bugzilla.redhat.com/show_bug.cgi?id=843836
      
      Currently gracefully shutting down guest vms on host shutdown does not work on
      Fedora 17, the guests are killed hard on system shutdown.
      
      The reason is systemd considers libvirt-guests.service to be stopped when the
      system is running:
      
      $ systemctl status libvirt-guests.service
      libvirt-guests.service - Suspend Active Libvirt Guests
                Loaded: loaded (/usr/lib/systemd/system/libvirt-guests.service;
      enabled)
                Active: deactivating (stop) since Fri, 27 Jul 2012 15:47:31 +0200;
      2min 48s ago
               Process: 1085 ExecStart=/etc/init.d/libvirt-guests start
      (code=exited, status=0/SUCCESS)
               Control: 1150 (libvirt-guests)
                CGroup: name=systemd:/system/libvirt-guests.service
                        └ control
                          ├ 1150 /bin/sh /etc/init.d/libvirt-guests stop
                          └ 2257 sleep 1
      
      libvirt-guests.service is defined as type "simple" in systemd (the default).
      That means systemd will shut down the service when the start executable is
      terminated after starting is done. Systemd will not call stop again on system
      shutdown because it thinks it is already stopped.
      
      The solution is to define it as type "oneshot" and set the flag
      "RemainAfterExit". Then systemd will consider the service as active after
      startup and will call the stop function on host shutdown.
      79ca7e4e
    • E
      maint: avoid regression on copyright listings · 3ad13c92
      Eric Blake 提交于
      Commit f9ce7dad tried to kill uses of a raw street address, but
      missed a few instances.  Automate things so we don't introduce
      new problems in the future.
      
      * cfg.mk (sc_copyright_address): New rule.
      (exclude_file_name_regexp--sc_copyright_address): Add exemption.
      * bootstrap.conf: Adjust offenders.
      * build-aux/augeas-gentest.pl: Likewise.
      * examples/systemtap/events.stp: Likewise.
      * examples/systemtap/qemu-monitor.stp: Likewise.
      * examples/systemtap/rpc-monitor.stp: Likewise.
      * src/dtrace2systemtap.pl: Likewise.
      * src/esx/esx_vi_generator.py: Likewise.
      * src/hyperv/hyperv_wmi_generator.py: Likewise.
      * src/remote/qemu_protocol.x: Likewise.
      * src/remote/remote_protocol.x: Likewise.
      * src/rpc/gensystemtap.pl: Likewise.
      * src/rpc/virnetprotocol.x: Likewise.
      * tests/object-locking.ml: Likewise.
      * tools/virt-xml-validate.in: Likewise.
      3ad13c92
    • O
      maint: Use consistent copyright. · a4bcefbc
      Osier Yang 提交于
      This is a follow up patch of commit f9ce7dad, it modifies all
      the files which declare the copyright like "See COPYING.LIB for
      the License of this software" to use the detailed/consistent one.
      
      And deserts the outdated comments like:
      
       * libvirt-qemu.h:
       * Summary: qemu specific interfaces
       * Description: Provides the interfaces of the libvirt library to handle
       *              qemu specific methods
       *
       * Copy:  Copyright (C) 2010, 2012 Red Hat, Inc.
      
      Uses the more compact style like:
      
       * libvirt-qemu.h: Interfaces specific for QEMU/KVM driver
       *
       * Copyright (C) 2010, 2012 Red Hat, Inc.
      a4bcefbc
    • P
      virsh: Fix error resetting on fallback paths · 2751ab28
      Peter Krempa 提交于
      On some fallback paths in virsh, error reported by the previously failed
      API is cleared by virResetLastError() that doesn't free error stored by
      virsh. This patch changes this to clear it using vshResetLibvirtError().
      2751ab28
    • P
      virsh: Refactor error clearing on graceful fallback paths · 3df9626c
      Peter Krempa 提交于
      Virsh uses an error handler to save errors from libvirt. On some code
      paths it's needed to clear libvirt errors and continue on fallback code
      paths without reporting failure.
      
      This patch adds function vshResetLibvirtError() that clears error
      returned by libvirt and updates all places where the old two-line method
      was used.
      3df9626c
  12. 26 7月, 2012 8 次提交
    • J
      virsh: check if specified debug level is in range · 4fedf388
      Ján Tomko 提交于
      4fedf388
    • P
      virsh: Check for existence of storage before undefining the domain · dcfb7050
      Peter Krempa 提交于
      When undefining a domain and removing associated storage using "virsh
      undefine --storage" the domain was at first undefined and after that the
      storage removal proces was started. If the user specified an invalid
      disk to remove, the error could not be corrected.
      
      This patch moves enumeration and filtering of volumes that should be
      removed before the domain is undefined, but the removal process is still
      kept after the domain has been undefined.
      dcfb7050
    • G
      util: set minimum value of nodesuspend duration to 60 seconds · 7aea9b8c
      Guannan Ren 提交于
      Change the permissible minimum value of nodesuspend duration time
      to 60 seconds. If option is less than the value, reports error.
      Update virsh help and manpage the infomation.
      7aea9b8c
    • O
      virsh: Move command group definition into its own file · c4bdf307
      Osier Yang 提交于
      * virsh-domain-monitor.c: Add domMonitoringCmds
      * virsh-domain.c: Add domManagementCmds
      * virsh-host.c: Add hostAndHypervisorCmds
      * virsh-interface.c: Add ifaceCmds
      * virsh-network.c: Add networkCmds
      * virsh-nodedev.c: Add nodedevCmds
      * virsh-nwfilter.c: Add nwfilterCmds
      * virsh-pool.c: Add storagePoolCmds
      * virsh-secret.c: Add secretCmds
      * virsh-snapshot.c: Add snapshotCmds
      * virsh-volume.c: Add storageVolCmds
      * virsh.c: Remove all the above *Cmds.
      c4bdf307
    • O
      virsh: Split cmds in node device group from virsh.c · 49989d70
      Osier Yang 提交于
      Commands in node device group moved from virsh.c to virsh-nodedev.c,
      
      * virsh.c: Remove commands in node device group.
      * virsh-nodedev.c: New file, filled with commands in node device group
      * po/POTFILES.in: Add virsh-nodedev.c
      * cfg.mk: Skip to check config.h including for virsh-nodedev.c
      49989d70
    • O
      virsh: Split cmds in host group from virsh.c · 290eb0d9
      Osier Yang 提交于
      Commands in host group moved from virsh.c to virsh-host.c,
      
      * virsh.c: Remove commands in host group.
      * virsh-host.c: New file, filled with commands in host group
      * po/POTFILES.in: Add virsh-host.c
      * cfg.mk: Skip to check config.h including for virsh-host.c
      290eb0d9
    • O
      virsh: Split cmds to manage domain snapshot from virsh.c · 648ad247
      Osier Yang 提交于
      Commands to manage domain snapshot are moved from virsh.c to
      virsh-snapshot.c.
      
      * virsh.c: Remove domain snapshot commands.
      * virsh-snapshot.c: New file, filled with domain snapshot commands.
      * po/POTFILES.in: Add virsh-snapshot.c
      * cfg.mk: Skip strcase and config.h including checking for
                virsh-snapshot.c
      648ad247
    • O
      virsh: Split cmds to manage secret from virsh.c · d7acdcf0
      Osier Yang 提交于
      Commands to manage secret are moved from virsh.c to virsh-secret.c,
      with a few helpers for secret command use.
      
      * virsh.c: Remove secret commands and a few helpers.
                 (vshCommandOptSecret, and vshCommandOptSecretBy)
      * virsh-secret.c: New file, filled with secret commands and its helpers.
      * po/POTFILES.in: Add virsh-secret.c
      * cfg.mk: Skip to check config.h including for virsh-secret.c
      d7acdcf0