Win32 doesn't have a concept of signal masks so disable that
code. It is unclear how SIGINT is delivered (if at all) on
Win32, so this might further work to provide an alternative
to pthread_sigmask
* tools/virsh.c: Avoid pthread_sigmask on Win32
Currently users who want to use virDomainQemuMonitorCommand() API or
it's virsh equivalent has to use the same protocol as libvirt uses for
communication to qemu. Since the protocol is QMP with current qemu and
HMP much more usable for humans, one ends up typing something like the
following:
virsh qemu-monitor-command DOM \
'{"execute":"human-monitor-command","arguments":{"command-line":"info kvm"}}'
which is not a very convenient way of debugging qemu.
This patch introduces --hmp option to qemu-monitor-command, which says
that the provided command is in HMP. If libvirt uses QMP to talk with
qemu, the command will automatically be converted into QMP. So the
example above is simplified to just
virsh qemu-monitor-command --hmp DOM "info kvm"
Also the result is converted from
{"return":"kvm support: enabled\r\n"}
to just plain HMP:
kvm support: enabled
If libvirt talks to qemu in HMP, --hmp flag is obviously a noop.
* src/fdstream.c (virFDStreamOpenFile, virFDStreamCreateFile):
Use VIR_FORCE_CLOSE instead of close.
* tests/commandtest.c (mymain): Likewise.
* tools/virsh.c (editFile): Use virCommand instead of system.
* src/util/util.c (__virExec): Special case preservation of std
file descriptors to child.
Use it in all places where a memory or storage request size is converted
to a larger granularity. This avoids requesting too small memory or storage
sizes that could result from the truncation done by a simple division.
This extends the round up fix in 6002e0406c
to the whole codebase.
Instead of reporting errors for odd values in the VMX code round them up.
Update the QEMU Argv tests accordingly as the original memory size 219200
isn't a even multiple of 1024 and is rounded up to 215 megabyte now. Change
it to 219100 and 219136. Use two different values intentionally to make
sure that rounding up works.
Update virsh.pod accordingly, as rounding down and rejecting are replaced
by rounding up.
If the memory of guest OS is changed constantly, the live migration
can not be ended ever for ever.
We can use the command 'virsh migrate-setmaxdowntime' to control the
live migration. But the value of maxdowntime is diffcult to calculate
because it depends on the transfer speed of network and constantly
changing memroy size. We need a easy way to control the live migration.
This patch adds the support of forcing guest to suspend at timeout.
With this patch, when we migrate the guest OS, we can specify a
timeout. If the live migration timeouts, auto-suspend the guest OS,
where the migration will complete offline.
While migration is in progress and virsh is waiting for its
completion, user may want to terminate the progress by pressing
Ctrl-C. But virsh just exits on user's Ctrl-C leaving migration
in background that user isn't even aware of. It's not reasonable.
This patch changes the behaviour for migration. For other
commands Ctrl-C still terminates virsh itself.
* .gnulib: Update to latest, for sigpipe and sigaction modules.
* bootstrap.conf (gnulib_modules): Add siaction, sigpipe, strerror_r.
* tools/virsh.c (vshSetupSignals) [!SIGPIPE]: Delete, now that
gnulib guarantees it.
(SA_SIGINFO): Define for mingw fallback.
* src/util/virterror.c (virStrerror): Simplify, now that gnulib
guarantees the POSIX interface.
* configure.ac (AC_CHECK_FUNCS_ONCE): Drop redundant check.
(AM_PROG_CC_STDC): Move earlier, to keep autoconf happy.
* tools/libvirt-guests.init.in: Rename...
* tools/libvirt-guests.init.sh: ...so that xgettext's language
detection via suffix will work.
* po/POTFILES.in: Update all references.
* tools/Makefile.am (EXTRA_DIST, libvirt-guests.init): Likewise.
* tools/libvirt-guests.init.sh: Use only POSIX shell features, which
includes using gettext.sh for translation rather than $"".
* tools/Makefile.am (libvirt-guests.init): Supply a few more substitutions.
* po/POTFILES.in: Mark that libvirt-guests.init needs translation.
Signed-off-by: Eric Blake <eblake@redhat.com>
Display or set unlimited values for memory parameters. Unlimited is
represented by INT64_MAX in memory cgroup.
Signed-off-by: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
Reported-by: Justin Clift <jclift@redhat.com>
The "Default-Stop" field in LSB comment in libvirt-guests is missing and should
be added. I also suggests to add runlevel 2 to the "Default-Start" field.
--
Laurent Léonard
When libvirt-guests is being stopped, I get the following message:
$Running guests on default URI: test-vm
$Suspending guests on default URI...
$Suspending test-vm: /etc/init.d/libvirt-guests: 340: Syntax error: Bad fd
number
Remove the optional option "group", as cmdHelp should accepts
only one option ("virsh help" supports both command and command
group now, and user rarely uses the options, so it doesn't matter
much for it being longer, :-)
* tools/virsh.c
* tools/virsh.c (find-storage-pool-sources-as and find-storage-pool-sources
should't be in command group "Domain Management", move them to group
"Storage Pool".
* tools/virsh.c (virsh shouldn't use 'phy' as the disk driver if
user doesn't specify "--driver", it causes bugs, as not all of
hypervisor driver supports 'phy', and actually hypervisor should
known the correct default disk driver and subdriver, so remove it)
As virsh help supports both command and command group now,
update "cmdHelp" to print consite help, (this patch is
increment of "7829052757953023b0826e0293ffe18ed4ab89e9").
And also remove redundant empty line in "vshUsage".
* tools/virsh.c
The output was previously:
-c | --connect <uri> hypervisor connection URI
-r | --readonly connect readonly
-d | --debug <num> debug level [0-5]
-h | --help this help
-q | --quiet quiet mode
-t | --timing print timing information
-l | --log <file> output logging to file
-v | --version[=short] program version
-V | --version=long version and full options
(note the blank line between the --version types)
This patch removes the extra blank line.
Change the virsh help out. The new output of "virsh help" and
"virsh --help" will be like:
Secret (help keyword 'secret'):
secret-define define or modify a secret from an XML file
secret-dumpxml secret attributes in XML
secret-set-value set a secret value
secret-get-value Output a secret value
secret-undefine undefine a secret
secret-list list secrets
Snapshot (help keyword 'snapshot'):
snapshot-create Create a snapshot
snapshot-current Get the current snapshot
snapshot-delete Delete a domain snapshot
snapshot-dumpxml Dump XML for a domain snapshot
snapshot-list List snapshots for a domain
snapshot-revert Revert a domain to a snapshot
Also support output help information of specified command group, e.g.
% ./tools/virsh help "Network Filter"
Network Filter (help keyword 'filter'):
nwfilter-define define or update a network filter from an XML file
nwfilter-undefine undefine a network filter
nwfilter-dumpxml network filter information in XML
nwfilter-list list network filters
nwfilter-edit edit XML configuration for a network filter
Each group has a help keyword, e.g.
% ./tools/virsh help filter
Network Filter (help keyword 'filter'):
nwfilter-define define or update a network filter from an XML file
nwfilter-undefine undefine a network filter
nwfilter-dumpxml network filter information in XML
nwfilter-list list network filters
nwfilter-edit edit XML configuration for a network filter
* tools/virsh.c:
- introduce new struct "vshCmdGrp" and macros to define the groups.
- split previous array "commands" into small arrays which are orgnized
by group
- changed some functions, e.g. "vshCmdDefSearch"
- Added new functions, e.g. "vshCmdGrpSearch"
- commands of each group are in "alphabetical order" now.
- command groups are in "alphabetical order" now.
- the commands are categorized with reference of
http://wiki.libvirt.org/page/VirshHelpV2 (by Justin)
- the modifications doesn't affect tests
* TODO:
- doc
Making this change makes it easier to spot the memory leaks
that will be fixed in the next patch.
* cfg.mk (sc_prohibit_xmlGetProp): New rule.
* .x-sc_prohibit_xmlGetProp: New exception.
* Makefile.am (EXTRA_DIST): Ship exception file.
* tools/virsh.c (cmdDetachInterface, cmdDetachDisk): Adjust
offenders.
* src/conf/storage_conf.c (virStoragePoolDefParseSource):
Likewise.
* src/conf/network_conf.c (virNetworkDHCPRangeDefParseXML)
(virNetworkIPParseXML): Likewise.
virsh was not checking for a error code when listing storage
volumes. So when listing volumes in a pool that was shutoff,
no output was displayed
* tools/virsh.c: Fix error handling when listing volumes
The "find-storage-pool-sources-as" command takes two arguments,
a hostname and a port number. For some reason the code would
also then look for a port number appended to the hostname
string by searching for ':'. This totally breaks if the user
gives an IPv6 address, and is redundant, since you can already
provide a port as a separate argument
* tools/virsh.c: Remove bogus port number handling code
The code generating XML for storage pool source discovery is
hardcoded to only allow a hostname and optional port number.
Refactor this code to make it easier to add support for extra
parameters.
* tools/virsh.c: Refactor XML generator
The virt-mem program is no longer shipped, but was still being
referenced at the bottom of the virsh and libvirtd man pages.
This patch removes it from those man pages, addressing
BZ# 639603:
https://bugzilla.redhat.com/show_bug.cgi?id=639603
Last time I ran ./autobuild.sh was on F13; and upgrading to F14
exposed these leftovers due to a newer gcov than what was in the stale
files, in the form of spurious messages that break 'make check':
+profiling:/home/remote/eblake/libvirt-tmp/tools/virsh-console.gcda:Version mismatch - expected 405R got 404R
and concluding with a bug in the autobuild.sh script itself:
./autobuild.sh: line 44: test: =: unary operator expected
* autobuild.sh: avoid syntax error on failed test
* tools/Makefile.am (CLEANFILES): Clean coverage files.