Commit Graph

876 Commits

Author SHA1 Message Date
Jiri Denemark
b8a32e0e94 build: Regenerate man pages on version bump
Whenever libvirt version changes in configure.ac, we need to regenerate
man pages so that they contain correct version info.
2013-01-29 13:23:19 +01:00
Peter Krempa
f8d5119e4f virsh: Add --print-xml flag for attach-disk command
The flag causes the XML of the disk that would be attached to be printed
instead.
2013-01-25 20:53:37 +01:00
Satoru Moriya
3dbabd29f5 node_memory: Add '\n' to help message
Linefeed is missed in the help of node-memory-tune.
This patch just adds '\n' to get a correct help message.

Signed-off-by: Satoru Moriya <satoru.moriya@hds.com>
2013-01-25 13:25:59 +08:00
Peter Krempa
a54f25a946 virsh-domain: Refactor error paths for cmdCPUStats
This patch fixes the following issues in the cpu-stats virsh command:

1) Renames label failed_params to no_memory to match coding style
2) Uses proper typed parameter cleanup in error paths to avoid leaks
3) Adds a ret variable and simplifies error labels
4) Changes error message to a slightly more descriptive one and gets rid
   of the newline at the end:

Before:
$ virsh cpu-stats tr
error: Failed to virDomainGetCPUStats()

error: Requested operation is not valid: domain is not running

After:
$ tools/virsh cpu-stats tr
error: Failed to retrieve CPU statistics for domain 'tr'
error: Requested operation is not valid: domain is not running
2013-01-22 17:36:45 +01:00
John Ferlan
0ce43ca4ab virsh: Need to intialize 'str'
It was possible to call VIR_FREE in error prior to initialization.
2013-01-22 17:29:26 +01:00
Jiri Denemark
de78bf604c Introduce virTypedParamsClear public API
The function is just a renamed public version of former
virTypedParameterArrayClear.
2013-01-18 15:04:00 +01:00
Jiri Denemark
f52e9f1f4d virsh: Use virTypedParams* APIs in cpu-stats 2013-01-18 15:04:00 +01:00
Jiri Denemark
c7805f4099 virsh: Use virTypedParams* APIs in node-memory-tune 2013-01-18 15:04:00 +01:00
Jiri Denemark
ec3e50644e virsh: Use virTypedParams* APIs in numatune 2013-01-18 15:04:00 +01:00
Jiri Denemark
7786233009 virsh: Use virTypedParams* APIs in memtune 2013-01-18 15:03:59 +01:00
Jiri Denemark
2e467de44a virsh: Use virTypedParams* APIs in domblkstat 2013-01-18 15:03:59 +01:00
Jiri Denemark
e982dacb45 virsh: Use virTypedParams* APIs in schedinfo 2013-01-18 15:03:59 +01:00
Jiri Denemark
9b2d2446af virsh: Use virTypedParams* APIs in domiftune 2013-01-18 15:03:59 +01:00
Jiri Denemark
39e5173a3d virsh: Use virTypedParams* APIs in blkiotune 2013-01-18 15:03:59 +01:00
Jiri Denemark
a8fca0da06 virsh: Use virTypedParams* APIs in blkdeviotune 2013-01-18 15:03:59 +01:00
Michal Privoznik
4909bcbbc1 virsh-volume.c: Switch to C99 initialization of vshCmdOptDef 2013-01-17 13:58:53 +01:00
Michal Privoznik
8571608924 virsh-snapshot.c: Switch to C99 initialization of vshCmdOptDef 2013-01-17 13:58:53 +01:00
Michal Privoznik
7c959c61de virsh-secret.c: Switch to C99 initialization of vshCmdOptDef 2013-01-17 13:58:53 +01:00
Michal Privoznik
20b19324e5 virsh-pool.c: Switch to C99 initialization of vshCmdOptDef 2013-01-17 13:58:53 +01:00
Michal Privoznik
7b48d69207 virsh-nwfilter.c: Switch to C99 initialization of vshCmdOptDef 2013-01-17 13:58:53 +01:00
Michal Privoznik
d140e25949 virsh-nodedev.c: Switch to C99 initialization of vshCmdOptDef 2013-01-17 13:58:53 +01:00
Michal Privoznik
b2621046c2 virsh-network.c: Switch to C99 initialization of vshCmdOptDef 2013-01-17 13:58:52 +01:00
Michal Privoznik
d54384187b virsh-interface.c: Switch to C99 initialization of vshCmdOptDef 2013-01-17 13:58:52 +01:00
Michal Privoznik
d616254849 virsh-host.c: Switch to C99 initialization of vshCmdOptDef 2013-01-17 13:58:52 +01:00
Michal Privoznik
9a069f94ec virsh-domain-monitor.c: Switch to C99 initialization of vshCmdOptDef 2013-01-17 13:58:52 +01:00
Michal Privoznik
99419bd11e virsh-domain.c: Switch to C99 initialization of vshCmdOptDef 2013-01-17 13:58:52 +01:00
Michal Privoznik
0f6c46c3d7 virsh.c: Switch to C99 initialization of vshCmdOptDef 2013-01-17 13:58:52 +01:00
John Ferlan
e69a85cc2b tools: Check return status on virBufferTrim() 2013-01-16 10:43:13 +01:00
John Ferlan
6c7c7cabf9 virsh: Remove unused setting of 'br_node' and 'if_node' 2013-01-15 23:43:10 +01:00
Daniel P. Berrange
e397f658b0 Add 'lxc-enter-namespace' command to virsh
Add a 'lxc-enter-namespace' command which accepts a domain name
and then a command + args to run, attached to the container

eg

  virsh -c lxc:/// lxc-enter-namespace demo -- /bin/ps -auxf

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-01-15 19:09:47 +00:00
Eric Blake
c726d9eca5 docs: remove extra "
* tools/virsh.pod: Fix typo.
2013-01-14 16:47:23 -07:00
Daniel P. Berrange
3d1596b048 Introduce an LXC specific public API & library
This patch introduces support for LXC specific public APIs. In
common with what was done for QEMU, this creates a libvirt_lxc.so
library and libvirt/libvirt-lxc.h header file.

The actual APIs are

  int virDomainLxcOpenNamespace(virDomainPtr domain,
                                int **fdlist,
                                unsigned int flags);

  int virDomainLxcEnterNamespace(virDomainPtr domain,
                                 unsigned int nfdlist,
                                 int *fdlist,
                                 unsigned int *noldfdlist,
                                 int **oldfdlist,
                                 unsigned int flags);

which provide a way to use the setns() system call to move the
calling process into the container's namespace. It is not
practical to write in a generically applicable manner. The
nearest that we could get to such an API would be an API which
allows to pass a command + argv to be executed inside a
container. Even if we had such a generic API, this LXC specific
API is still useful, because it allows the caller to maintain
the current process context, in particular any I/O streams they
have open.

NB the virDomainLxcEnterNamespace() API is special in that it
runs client side, so does not involve the internal driver API.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-01-14 13:58:34 +00:00
Daniel P. Berrange
d3b05abfa9 Convert HAVE_UDEV to WITH_UDEV
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-01-14 13:26:47 +00:00
Peter Krempa
d0b8bc8565 virsh: Reformat output of virsh net-list
This patch changes whitespace and the length of the separation line from
this format:

$ virsh net-list --all
Name                 State      Autostart     Persistent
--------------------------------------------------
default              inactive   yes           yes

to

$ virsh net-list --all
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 default              inactive   yes           yes

to match the output of virsh list.
2013-01-11 14:05:52 +01:00
Daniel P. Berrange
4da3000c66 Convert HAVE_SANLOCK to WITH_SANLOCK
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-01-11 11:03:23 +00:00
Daniel P. Berrange
24bcd8d45a Move qemu-XXX commands from virsh-host.c to virsh-domain.c
The QEMU specific APIs all operate on domains, not the host,
so should be in the virsh-domain.c file / group

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-01-08 08:56:49 +00:00
Eric Blake
5ec4b22b77 build: .service files don't need to be executable
See also commit 66ff2dd, where we avoided installing these files
as executables.

* daemon/Makefile.am (libvirtd.service): Drop chmod.
* tools/Makefile.am (libvirt-guests.service): Likewise.
* src/Makefile.am (virtlockd.service, virtlockd.socket):
Likewise.
2013-01-07 08:56:36 -07:00
Eric Blake
462a69621e build: use common .in replacement mechanism
We had several different styles of .in conversion in our Makefiles:
ALLCAPS, @ALLCAPS@, @lower@, ::lower::
Canonicalize on one form, to make it easier to copy and paste
between .in files.

Also, we were using some non-portable sed constructs: \@ is an
undefined escape sequence (it happens to be @ itself in GNU sed,
but POSIX allows it to mean something else), as well as risky
behavior (failure to consistently quote things means a space
in $(sysconfdir) could throw things off; also, Autoconf recommends
using | rather than , or ! in the s||| operator, because | has to
be quoted in shell and is therefore less likely to appear in file
names than , or !).

Fix all of these uses to follow the same syntax.

* daemon/libvirtd.8.in: Switch to @var@.
* tools/virt-xml-validate.in: Likewise.
* tools/virt-pki-validate.in: Likewise.
* src/locking/virtlockd.init.in: Likewise.
* daemon/Makefile.am: Prefer | over ! in sed.
(libvirtd.8): Prefer consistent substitution.
(libvirtd.init, libvirtd.service): Avoid non-portable sed.
* tools/Makefile.am (libvirt-guests.sh, libvirt-guests.init)
(libvirt-guests.service): Likewise.
(virt-xml-validate, virt-pki-validate, virt-sanlock-cleanup):
Prefer consistent capitalization.
* src/Makefile.am (virtlockd.init, virtlockd.service)
(virtlockd.socket): Prefer consistent substitution.
2013-01-07 08:56:36 -07:00
Daniel P. Berrange
f24404a324 Rename virterror.c virterror_internal.h to virerror.{c,h} 2012-12-21 11:19:50 +00:00
Daniel P. Berrange
556cf5f617 Rename xml.{c,h} to virxml.{c,h} 2012-12-21 11:19:50 +00:00
Daniel P. Berrange
44f6ae27fe Rename util.{c,h} to virutil.{c,h} 2012-12-21 11:19:49 +00:00
Daniel P. Berrange
404174cad3 Rename threads.{c,h} to virthread.{c,h} 2012-12-21 11:19:49 +00:00
Daniel P. Berrange
ab9b7ec2f6 Rename memory.{c,h} to viralloc.{c,h} 2012-12-21 11:17:14 +00:00
Daniel P. Berrange
936d95d347 Rename logging.{c,h} to virlog.{c,h} 2012-12-21 11:17:14 +00:00
Daniel P. Berrange
6a095d0851 Rename json.{c,h} to virjson.{c,h} 2012-12-21 11:17:13 +00:00
Daniel P. Berrange
4d6050a8eb Rename event_poll.{c,h} to vireventpoll.{c,h} 2012-12-21 11:17:13 +00:00
Daniel P. Berrange
04d9510f50 Rename command.{c,h} to vircommand.{c,h} 2012-12-21 11:17:13 +00:00
Daniel P. Berrange
2005f7b552 Rename buf.{c,h} to virbuffer.{c,h}
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-12-21 11:17:12 +00:00
Daniel P. Berrange
a27e4fbb72 Rename bitmap.{c,h} to virbitmap.{c,h}
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-12-21 11:17:12 +00:00
Ján Tomko
8d0e7eb4c1 virsh: use vshReconnect for non-default connections too
For non-default connections (specified by the environment variable or
the command line option) we call virConnectOpenAuth without registering
the vshCatchDisconnect callback.

This calls vshReconnect instead which takes care of it.
2012-12-13 16:39:38 +01:00