Commit Graph

63 Commits

Author SHA1 Message Date
Eric Blake
2a1aaa609e virsh: add qemu-monitor-command --pretty
I was using qemu-monitor-command during development, and found it quite
hard to use.  Compare the results of this patch on ease of reading:

$ virsh qemu-monitor-command          dom '{"execute":"query-version"}'
{"return":{"qemu":{"micro":1,"minor":12,"major":0},"package":"(qemu-kvm-0.12.1.2)"},"id":"libvirt-7683"}

$ virsh qemu-monitor-command --pretty dom '{"execute":"query-version"}'
{
    "return": {
        "qemu": {
            "micro": 1,
            "minor": 12,
            "major": 0
        },
        "package": "(qemu-kvm-0.12.1.2)"
    },
    "id": "libvirt-7674"
}

* tools/virsh-host.c (cmdQemuMonitorCommand): New option.
* tools/virsh.pod (qemu-monitor-command): Document it.
2012-10-08 15:47:06 -06:00
Eric Blake
4ecb723b9e maint: fix up copyright notice inconsistencies
https://www.gnu.org/licenses/gpl-howto.html recommends that
the 'If not, see <url>.' phrase be a separate sentence.

* tests/securityselinuxhelper.c: Remove doubled line.
* tests/securityselinuxtest.c: Likewise.
* globally: s/;  If/.  If/
2012-09-20 16:30:55 -06:00
Osier Yang
0e96fa5489 node_memory: Expose the APIs to virsh
New command node-memory-tune to get/set the node memory parameters,
only two parameters are allowed to set (pages_to_scan, and sleep_millisecs,
see documents in this patch for more details).

Example of node-memory-tune's output:

Shared memory:
	pages_to_scan   100
	sleep_millisecs 20
	pages_shared    0
	pages_sharing   0
	pages_unshared  0
	pages_volatile  0
	full_scans      0
2012-09-17 13:55:35 +08:00
Peter Krempa
67f83cd497 virsh: remove unneeded usage of vshConnectionUsability()
Now that vshCommandRun() checks for the connection automaticaly, remove
all of the redundant checks in the code.

vshConnectionUsability() no longer needs to be exported and this patch
marks it static.
2012-08-31 16:22:22 +02:00
Alex Jia
34c5ab9566 virsh: fix missing return value
Although virsh command raises a correct error information, the command status
returns 0(true), this patch is used for fixing this issue.

Signed-off-by: Alex Jia <ajia@redhat.com>
2012-08-27 14:35:38 +08:00
MATSUDA Daiki
bf51299d57 agent: add qemu-agent-command to virsh
Add qemu-agent-command to virsh to support virDomainQemuAgentCommand().

Signed-off-by: MATSUDA Daiki <matsudadik@intellilink.co.jp>
2012-08-23 19:11:03 +08:00
Eric Blake
4c10b3c7da virsh: declare more common functions
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.
2012-08-20 23:56:18 -06:00
Eric Blake
ae8e89fb12 virsh: split out virsh-host.c
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.
2012-08-20 23:51:29 -06:00
Martin Kletzander
4d448b1156 docs/virsh: various minor fixes
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
2012-08-10 10:58:54 +02:00
Osier Yang
e534ec66dc virsh: Use vshPrint instead of printf 2012-08-06 12:35:42 +08:00
Guannan Ren
7aea9b8cf7 util: set minimum value of nodesuspend duration to 60 seconds
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.
2012-07-26 15:29:03 +08:00
Osier Yang
c4bdf307e0 virsh: Move command group definition into its own file
* 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.
2012-07-26 12:00:43 +08:00
Osier Yang
290eb0d9f2 virsh: Split cmds in host group from virsh.c
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
2012-07-26 12:00:43 +08:00