Commit Graph

204 Commits

Author SHA1 Message Date
Cole Robinson
6852c88fc7 Virsh commands vol-clone and vol-create-from
vol-clone is a convenience function, requiring only a volume to clone and a
new name.

vol-create-from is a direct mapping to the public API, which allows cloning
across pools, converting between formats, etc, but requires an xml file to be
passed
2009-05-12 20:17:21 +00:00
Daniel P. Berrange
9927ca6274 Report detailed error if initial connection open attempt fails 2009-05-11 14:55:52 +00:00
Daniel P. Berrange
cb4a6614fa Fix check for -Wformat-security which depends on -Wformat 2009-04-28 10:55:45 +00:00
Daniel Veillard
f61208bde9 * src/virsh.c: fix for virsh ttyconsole return value bug #495954
daniel
2009-04-15 20:09:09 +00:00
Daniel P. Berrange
f0817018b1 Allow autoconnect to virsh console in create/start. Refuse to connect to remote consoles 2009-04-03 14:03:38 +00:00
Daniel P. Berrange
92ff72b52c Misc NUMA related fixes 2009-04-03 12:45:05 +00:00
Daniel P. Berrange
45707d5631 Add treeview to node device listing in virsh 2009-04-01 09:52:59 +00:00
Daniel Veillard
aac6018a35 fix missing authentication on virsh shell commands
* src/virsh.c: fix missing authentication when command are issued
  from the shell, patch by Matthias Bolte
Daniel
2009-03-23 16:36:32 +00:00
Daniel P. Berrange
4ebe4c108d Fix misc failures in test suite & make test cases more robust to future changes 2009-03-04 13:04:06 +00:00
Daniel P. Berrange
aa2c97263d virsh additions for sVirt support (James Morris & Dan Walsh) 2009-03-03 09:59:02 +00:00
Jim Meyering
9883bec50d virsh: tweak a format string to avoid emitting trailing space
* src/virsh.c (cmdNetworkList): Change format not to right-pad
with spaces, as that would have required a trailing blank in
an expected output file.
2009-03-02 18:39:36 +00:00
Daniel Veillard
6427091ffe * src/virsh.c: add 3 new commands for node device detach, reattach and reset,
patch by Mark McLoughlin.
Daniel
2009-03-02 16:28:17 +00:00
Cole Robinson
3a53ab7913 Unbreak virsh *-edit commands: Don't pass unexpected flags to DumpXML 2009-02-16 22:51:31 +00:00
John Levon
f84c166013 Improve error reporting in virsh 2009-02-09 14:24:06 +00:00
Daniel P. Berrange
1290b28f59 Limit virsh history entries to 500 (Jim Paris) 2009-02-09 10:24:27 +00:00
John Levon
745c249a61 Fix yet another printf("%s", NULL) case
Fix getpwuid_r() usage
Fix virsh migrateuri handling
2009-01-30 15:43:05 +00:00
Daniel P. Berrange
3801794908 Support VNC password setting in QEMU driver 2009-01-29 17:50:00 +00:00
Guido Günther
a99e5ccba4 don't abort if setlocale() fails 2009-01-29 11:49:33 +00:00
Jim Meyering
8f06d6b103 avoid bogus descriptions due to use of gettext with the empty string
* src/virsh.c: Use `""', not `gettext_noop("")', in numerous
vshCmdInfo definitions.  The latter provokes a warning from gettext.
2009-01-05 13:27:43 +00:00
Guido Günther
043d702f02 use virAsprintf instead of asprintf 2008-12-23 13:03:29 +00:00
Cole Robinson
bd24695a23 Merge xml building for virsh pool-*-as 2008-12-22 16:23:36 +00:00
Jim Meyering
289d52c49e remove redundant optname arguments
This is the second part of the change mentioned here:

  http://thread.gmane.org/gmane.comp.emulators.libvirt/10331

It removes the essentially redundant "optname" parameter
from each of the vshCommandOptNetworkBy and vshCommandOptDomainBy
functions as well as the correspond macros (without "By" suffix).
Now, instead of always passing the optname, "domain", to
vshCommandOptDomainBy, that function requires that its command
argument refer to an opts array containing a "domain" option.

This normalization makes one more help-related change:
it renames the net-start "name" argument to the more
sensible and consistent "network".
* src/virsh.c (VSH_BYNAME, vshCommandOptDomain)
(cmd_has_option): New function, used in vshCommandOptDomainBy
and vshCommandOptNetworkBy.
(vshCommandOptDomainBy, vshCommandOptNetworkBy): Remove the optname
parameter, it's always "domain" ("network").  Update all callers.
Call cmd_has_option.
(vshCommandOptNetwork, cmdAutostart, cmdConsole, cmdDomstate)
(cmdDomblkstat, cmdDomIfstat, cmdSuspend, cmdUndefine, cmdStart)
(cmdSave, cmdSchedinfo, cmdDump, cmdResume, cmdShutdown)
(cmdReboot, cmdDestroy, cmdDominfo, cmdVcpuinfo, cmdVcpupin)
(cmdSetvcpus, cmdSetmem, cmdSetmaxmem, cmdDumpXML, cmdDomname)
(cmdDomid, cmdDomuuid, cmdMigrate, cmdNetworkAutostart)
(cmdNetworkDestroy, cmdNetworkDumpXML, cmdNetworkName)
(opts_network_start, cmdNetworkStart, cmdNetworkUndefine)
(cmdNetworkUuid, cmdVNCDisplay, cmdTTYConsole, cmdAttachDevice)
(cmdDetachDevice, cmdAttachInterface, cmdDetachInterface)
(cmdAttachDisk, cmdDetachDisk, cmdEdit)
* src/Makefile.am (virsh-pool-edit.c): This code is generated
from cmdEdit, and cmdEdit uses the vshCommandOptDomain macro which
now, with the changes above, has only 3 (was 4) arguments, yet the
macro use is mapped to vshCommandOptPool, which still requires 4
arguments.  So this change adjusts the sed code to reinsert the
just-removed argument -- we're not changing pool-related code right
now, because it's not as straight-forward.
2008-12-15 10:26:54 +00:00
Jim Meyering
9c5470d292 remove cvs $Id$ strings
* po/id.po: Likewise.
* qemud/remote_generate_stubs.pl: Likewise.
* src/virsh.c: Likewise.
* tests/testutils.c: Likewise.
* tests/testutils.h: Likewise.
* RENAMES: Likewise.
2008-12-12 12:45:34 +00:00
Jim Meyering
3693a02fff fix just-broken "virsh start" and "virsh pool-start" commands
* src/virsh.c (cmdPoolStart, cmdStart): Change hard-coded
vshCommandOptDomainBy string argument to match just-changed
option name.  Cole Robinson reported that "virsh start" was
broken and provided that part of the fix.
Bug introduced by yesterday's "virsh.c: tweak options to produce
more accurate help".
* tests/start: New file.  Test for the above fix.
* tests/Makefile.am (test_scripts): Add start.
2008-12-09 21:38:04 +00:00
Jim Meyering
1c9968a2b1 virsh.c: tweak options to produce more accurate help
* src/virsh.c: Adjust some vshCmdOptDef command option flags
to improve auto-generated help command syntax.
2008-12-08 13:22:44 +00:00
Jim Meyering
c9319f315c virsh.c: remove all "syntax" vshCmdInfo entries.
* src/virsh.c: ... now that info is generated.
2008-12-08 13:22:13 +00:00
Jim Meyering
34e5d2941c virsh.c: add missing (yet empty) "desc" strings
* src/virsh.c: Now, every command must have a "desc" string,
even if it has zero length.  Mark these, so they'll be filled in.
2008-12-08 13:21:30 +00:00
Jim Meyering
6f61232852 virsh.c: generate each "virsh help COMMAND"s synopsis
* src/virsh.c: Also, diagnose extra arguments after --help (-h).
2008-12-08 13:14:48 +00:00
Cole Robinson
76944e8137 Fix documentation cut and paste errors, and a virsh typo. 2008-12-04 14:51:57 +00:00
Jim Meyering
62bcd5d32b tests: new test: virsh-synopsis
* tests/virsh-synopsis: new file
* tests/Makefile.am (test_scripts): Add virsh-synopsis.
* src/virsh.c: Correct help SYNOPSIS for each of seven commands.

When I first ran this script, "make check" failed like this:
  ...
  invalid help SYNOPSIS for net-create:
      create a network from an XML <file>
  invalid help SYNOPSIS for net-define:
      define a network from an XML <file>
  invalid help SYNOPSIS for net-start:
      start <network>
  invalid help SYNOPSIS for pool-create:
      create a pool from an XML <file>
  invalid help SYNOPSIS for pool-define:
      define a pool from an XML <file>
  invalid help SYNOPSIS for pool-start:
      start <pool>
  invalid help SYNOPSIS for vol-create:
      create <file>
  FAIL: virsh-synopsis
2008-11-24 07:13:29 +00:00
Daniel P. Berrange
145bb1e821 Misc tweaks to node device impl 2008-11-21 12:46:39 +00:00
Daniel P. Berrange
1ee5367c19 Node device support in virsh (David Lively) 2008-11-21 12:39:48 +00:00
Daniel P. Berrange
25047e7cf8 Use a versioned linker script 2008-11-17 11:03:25 +00:00
Daniel Veillard
df285bdd8d KVM/QEmu migration support
* qemud/remote.c qemud/remote_dispatch_localvars.h
  qemud/remote_dispatch_proc_switch.h qemud/remote_dispatch_prototypes.h
  qemud/remote_protocol.c qemud/remote_protocol.h
  qemud/remote_protocol.x src/driver.h src/libvirt.c
  src/libvirt_internal.h src/libvirt_sym.version src/lxc_driver.c
  src/openvz_driver.c src/qemu_conf.h src/qemu_driver.c
  src/remote_internal.c src/test.c src/virsh.c: large patch to
  add migration support for KVM/QEmu, based on the work of Rich Jones
  and Chris Lalancette. This introduce a new version of the prepare
  and finish steps of the migration, so changes the driver API and
  a lot of code.
Daniel
2008-11-14 08:42:47 +00:00
Jim Meyering
fd52c6ff67 avoid many format string warnings
Building with --disable-nls exposed many new warnings like these:
virsh.c:4952: warning: format not a string literal and no format ...
util.c:163: warning: format not a string literal and no format arguments
All but one of the following changes add a "%s" argument before
the offending _(...) argument.

This was the only manual change:
* src/lxc_driver.c (lxcVersion): Use %s and strerror(errno)
rather than %m, to avoid a warning from gcc -Wformat-security.

Add "%s" before each warned about format-string-with-no-%-directive:
* src/domain_conf.c (virDomainHostdevSubsysUsbDefParseXML)
(virDomainDefParseString, virDomainDefParseFile):
* src/hash.c (virGetConnect, __virGetDomain, virReleaseDomain)
(__virGetNetwork, virReleaseNetwork, __virGetStoragePool)
(virReleaseStoragePool, __virGetStorageVol, virReleaseStorageVol):
* src/lxc_container.c (lxcContainerChild):
* src/lxc_driver.c (lxcDomainDefine, lxcDomainUndefine)
(lxcDomainGetInfo, lxcGetOSType, lxcDomainDumpXML)
(lxcSetupInterfaces, lxcDomainStart, lxcDomainCreateAndStart)
(lxcVersion, lxcGetSchedulerParameters):
* src/network_conf.c (virNetworkDefParseString)
(virNetworkDefParseFile):
* src/openvz_conf.c (openvzReadNetworkConf, openvzLoadDomains):
* src/openvz_driver.c (openvzDomainDefineCmd)
(openvzDomainGetInfo, openvzDomainDumpXML, openvzDomainShutdown)
(openvzDomainReboot, ADD_ARG_LIT, openvzDomainDefineXML)
(openvzDomainCreateXML, openvzDomainCreate, openvzDomainUndefine)
(openvzDomainSetAutostart, openvzDomainGetAutostart)
(openvzDomainSetVcpus):
* src/qemu_driver.c (qemudDomainBlockPeek, qemudDomainMemoryPeek):
* src/remote_internal.c (remoteDomainBlockPeek)
(remoteDomainMemoryPeek, remoteAuthPolkit):
* src/sexpr.c (sexpr_new, _string2sexpr):
* src/storage_backend_disk.c (virStorageBackendDiskMakeDataVol)
(virStorageBackendDiskCreateVol):
* src/storage_backend_fs.c
(virStorageBackendFileSystemNetFindPoolSources):
* src/storage_backend_logical.c (virStorageBackendLogicalFindLVs)
(virStorageBackendLogicalFindPoolSources):
* src/test.c (testOpenDefault, testOpenFromFile, testOpen)
(testGetDomainInfo, testDomainRestore)
(testNodeGetCellsFreeMemory):
* src/util.c (virExec):
* src/virsh.c (cmdAttachDevice, cmdDetachDevice)
(cmdAttachInterface, cmdDetachInterface, cmdAttachDisk)
(cmdDetachDisk, cmdEdit):
* src/xend_internal.c (do_connect, wr_sync, xend_op_ext)
(urlencode, xenDaemonDomainCreateXML)
(xenDaemonDomainLookupByName_ids, xenDaemonDomainLookupByID)
(xenDaemonParseSxprOS, xend_parse_sexp_desc_char)
(xenDaemonParseSxprChar, xenDaemonParseSxprDisks)
(xenDaemonParseSxpr, sexpr_to_xend_topology, sexpr_to_domain)
(xenDaemonDomainFetch, xenDaemonDomainGetAutostart)
(xenDaemonDomainSetAutostart, xenDaemonDomainMigratePerform)
(xenDaemonDomainDefineXML, xenDaemonGetSchedulerType)
(xenDaemonGetSchedulerParameters)
(xenDaemonSetSchedulerParameters, xenDaemonDomainBlockPeek)
(xenDaemonFormatSxprChr, virDomainXMLDevID):
* src/xm_internal.c (xenXMConfigCacheRefresh, xenXMDomainPinVcpu)
(xenXMDomainCreate, xenXMDomainDefineXML)
(xenXMDomainAttachDevice, xenXMDomainDetachDevice):
* src/xml.c (virXPathString, virXPathNumber, virXPathLong)
(virXPathULong, virXPathBoolean, virXPathNode, virXPathNodeSet):
* src/xs_internal.c (xenStoreOpen):
2008-10-13 16:46:28 +00:00
Daniel Veillard
f6803c960f virDomainDefineXML, and a few additional cleanups
* include/libvirt/libvirt.h[.in] include/libvirt/virterror.h
  qemud/remote* src/driver.h src/libvirt.c src/libvirt_sym.version
  src/lxc_driver.c src/openvz_driver.c src/proxy_internal.c
  src/qemu_driver.c src/remote_internal.c src/test.c src/virsh.c
  src/xen_internal.c src/xen_unified.c src/xen_unified.h
  src/xend_internal.c src/xend_internal.h src/xm_internal.c
  src/xs_internal.c docs/*: cleanup virDomainCreateLinux into
  virDomainDefineXML, and a few additional cleanups
Daniel
2008-10-10 09:32:27 +00:00
Daniel P. Berrange
218334d1b2 Fix two compile warnings 2008-10-09 14:50:25 +00:00
Dan Smith
6c504d6a7c Add LXC scheduling parameters and support in virsh schedinfo 2008-10-08 16:28:48 +00:00
Richard W.M. Jones
3b7c7d888a Change name of "blocked" state to "idle" (John Levon). 2008-09-17 14:18:15 +00:00
Daniel Veillard
54a4f8d44d add output on attach and detach success
* src/virsh.c: patch from Cole Robinson to add output on attach
  and detach success
daniel
2008-09-03 12:38:28 +00:00
Daniel Veillard
41ce15a586 Adds storage source element for pools
* src/storage_backend.h src/storage_backend_logical.c
src/storage_conf.c src/storage_conf.h src/virsh.c:
Applied patches from David Lively to add storage source
elements needed for storage pool
* docs/formatstorage.html docs/formatstorage.html.in: associated
documentation
Daniel
2008-09-02 14:15:42 +00:00
Daniel P. Berrange
39c9354c5c Add storage pool source discovery support (patch from David Lively) 2008-08-27 20:05:58 +00:00
Atsushi SAKAI
6fd4c30285 fix typos src/virsh.c from John Levon,
and 3 more files(src/domain_conf.c src/openvz_driver.c src/qemu_driver.c)
2008-08-15 01:41:49 +00:00
Atsushi SAKAI
43c7f972aa fix compilation for MinGW 2008-08-12 08:25:48 +00:00
Richard W.M. Jones
969fa847c1 'virsh edit' and related commands
* src/virsh.c: Implement 'virsh edit', 'virsh net-edit' and
	  'virsh pool-edit' commands.  These edit the XML for domains,
	  networks and storage pools respectively, and are the
	  equivalent of doing 'virsh dumpxml; vi foo.xml; virsh define'
	* src/Makefile.am, src/.cvsignore: Auto-generate the net-edit
	  and pool-edit commands.
	* docs/virsh.pod: Updated the documentation.
2008-08-01 14:30:41 +00:00
Jim Meyering
66f9bb5b95 virsh.c: more const-correctness fixes 2008-08-01 13:51:18 +00:00
Richard W.M. Jones
3f3345aa85 Const-correctness fixes in virsh.c
* src/virsh.c: Const-correctness.
2008-08-01 12:19:56 +00:00
Jim Meyering
2eb8ab2057 better diagnostic when failing to undefine a running domain via ID
* src/virsh.c (cmdUndefine): Tell user to shutdown and then use name or UUID.
* tests/undefine: New test.  Exercise virsh's undefine command.
* tests/Makefile.am (test_scripts): Add undefine.
2008-07-22 16:12:01 +00:00
Daniel Veillard
16b8942966 undefine command can't take an ID
* src/virsh.c: patch from Evgeniy Sokolov for the undefine command
  which can't take an id
Daniel
2008-07-17 11:49:15 +00:00
Daniel P. Berrange
a9d4944f8e Don't add trailing blanks in dominfo output 2008-05-29 14:56:12 +00:00