1. 31 8月, 2012 2 次提交
  2. 22 8月, 2012 2 次提交
  3. 21 8月, 2012 2 次提交
    • 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-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
  4. 20 8月, 2012 2 次提交
    • 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
  5. 18 8月, 2012 2 次提交
    • 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: 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
  6. 16 8月, 2012 1 次提交
  7. 14 8月, 2012 1 次提交
  8. 27 7月, 2012 1 次提交
    • 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
  9. 26 7月, 2012 3 次提交
    • 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
    • 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 of domain group from virsh.c · 73b89ed8
      Osier Yang 提交于
      This splits commands to manage domain into virsh-domain.c,The helpers
      not for common use are moved into them too. Standard copyright is added
      for the new file.
      
      * tools/virsh.c:
        - Remove commands for domain group, and one helper
          (vshDomainVcpuStateToString)
        - vshStreamSink is moved before commands's definition for it's
          also used by commands not of domain group, such as volUpload.
      
      * tools/virsh-domain.c:
        - New file, commands for domain group and the one helper are
          moved into it.
      
      * po/POTFILES.in:
        - Add virsh-domain.c
      
      * cfg.mk:
        - Skip to check config.h including for virsh-domain.c
      73b89ed8