Commit Graph

222 Commits

Author SHA1 Message Date
Laine Stump
3ced80b54a Fix a memory leak in virsh
* src/virsh.c: cmdNodeDeviceDumpXML wasn't freeing
  virNodeDeviceGetXMLDesc() return string
2009-09-04 15:38:15 +02:00
Pritesh Kothari
544cd63062 Fix crash in virsh vol-key command
* src/virsh.c: Pass in pool object to avoid crash in key lookup
2009-08-27 18:47:41 +01:00
Mark McLoughlin
097c818bf0 Cosmetic change to 'virsh nodedev-list --tree' output
Maybe it's just me, but I try to select an item from the tree using
double-click and get annoyed when "+-" gets included in the selection.

* src/virsh.c: add a space between "+-" and the node device name
  in 'virsh nodedev-list --tree'
2009-08-18 09:41:56 +01:00
Daniel P. Berrange
55bc5090b9 Implement schedular tunables API using cgroups
* src/qemu_driver.c:  Add driver methods qemuGetSchedulerType,
  qemuGetSchedulerParameters, qemuSetSchedulerParameters
* src/lxc_driver.c: Fix to use unsigned long long consistently
  for schedular parameters
* src/cgroup.h, src/cgroup.c: Fix cpu_shares to take unsigned
  long long
* src/util.c, src/util.h, src/libvirt_private.syms: Add a
  virStrToDouble helper
* src/virsh.c: Fix handling of --set arg to schedinfo command
  to honour the designated data type of each schedular tunable
  as declared by the driver
2009-07-23 17:38:06 +01:00
Laine Stump
165ed4a00e Add bare format string to printf-derivatives troubles
* src/datatypes.c src/domain_conf.c src/interface_conf.c
  src/lxc_driver.c src/qemu_driver.c src/storage_backend.c src/virsh.c:
  add bare %s format string to printf-derivatives called with no format
  string
2009-07-23 18:27:47 +02:00
Daniel P. Berrange
899ae0d2b5 Fix misc Win32 compile warnings
GCC >= 4.4 assumes the 'printf' attribute refers to the native
runtime libraries format specifiers. Thanks to gnulib, libvirt
has GNU format specifiers everywhere.  This means we need to
use 'gnu_printf' with GCC >= 4.4 to get correct compiler
checking of printf format specifiers.

* HACKING: Document new rules for ATTRIBUTE_FMT_PRINTF
* autobuild.sh, mingw32-libvirt.spec.in: Disable OpenNebula
  driver on mingw32 builds
* qemud/dispatch.h, qemud/qemu.h, src/buf.h src/internal.h,
  src/logging.h, src/security.h, src/sexpr.h, src/util.h,
  src/virterror_internal.h, src/xend_internal.c: Change
  over to ATTRIBUTE_FMT_PRINTF.
* src/virsh.c: Disable 'cd' and 'pwd' commands on Win32
  since they don't compile
* src/threads-win32.c: Add missing return value check
2009-07-23 16:07:32 +01:00
Laine Stump
d26d18a1a6 Fix multiple memory leaks in virsh
* virsh.c: fix a number of leaks of virDomain, virStoragePool,
  virNodeDevice, etc.
2009-07-22 15:46:16 +02:00
Laine Stump
1499e1d5f4 Rename variable for compilation in Mingw32
* src/virsh.c: rename interface into iface
2009-07-22 10:32:03 +02:00
Daniel Veillard
86941f55d5 Remove some unused variables and cut long lines
* src/virsh.c: a bit of cleanup on previous commit
2009-07-16 22:04:24 +02:00
Laine Stump
6b56ac24df Add virsh commands for network interface management
* src/virsh.c: add a number of interface related commands:
  iface-list, iface-name, iface-mac, iface-dumpxml, iface-define,
  iface-undefine, iface-edit, iface-start and iface-destroy
2009-07-16 21:44:10 +02:00
Paolo Bonzini
c4951f11b7 add cd and pwd commands to virsh
* src/virsh.c: adds cd and pwd commands to virsh useful for save and
  restore commands
* docs/virsh.pod virsh.1: update the documentation
* AUTHORS: add Paolo Bonzini
2009-07-16 16:40:08 +02:00
Daniel P. Berrange
73f34b31f5 Fix broken dominfo command when no security driver is implemented 2009-06-25 09:37:22 +00:00
Daniel Veillard
3621d42e0f * src/openvz_conf.c src/virsh.c: various typo or english fixups
raised by Runa Bhattacharjee
daniel
2009-06-03 12:13:52 +00:00
Daniel Veillard
81d0ffbc3b NPIV implementation for node device create and destroy
* src/Makefile.am src/node_device.[ch] src/node_device_conf.[ch]
  src/node_device_hal.[ch] src/node_device_hal_linux.c
  src/qemu_driver.c src/remote_internal.c src/storage_backend.c
  src/virsh.c src/xen_unified.c tests/nodedevxml2xmltest.c
  po/POTFILES.in: implementation for node device create and destroy
  in NPIV support, patch by David Allan
Daniel
2009-06-02 15:12:53 +00:00
Cole Robinson
58c73c1789 virsh: Use consistent spacing for net-list
There is different spacing when listing active vs. inactive networks. Ex:

Name                 State      Autostart
-----------------------------------------
default              active     yes
xxxxxx               inactive no
2009-05-29 14:00:41 +00:00
Daniel P. Berrange
4d5383fd36 public API for domain XML conversions 2009-05-21 13:46:35 +00:00
Cole Robinson
bb175dfc53 Don't validate disk type in virsh attach-disk
Let the underlying driver tell us what it supports. At the moment
we are at least erroneously denying floppy eject/insert.
2009-05-19 13:04:46 +00:00
Cole Robinson
ee0d7552e2 Fix a few 'used uninitialized' warnings. 2009-05-13 17:43:47 +00:00
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