Commit Graph

405 Commits

Author SHA1 Message Date
Peter Krempa
0f95f31c83 lib: Introduce VIR_DOMAIN_VCPU_HOTPLUGGABLE for virDomainSetVcpusFlags
For compatibility reasons virDomainSetVcpus needs to add vcpus as non
hotpluggable which means that the users will not be able to unplug it
after the VM has started. Add a flag that will allow to tell the API
that the unpluggable vcpus are okay.
2016-10-05 09:05:52 +02:00
Nikolay Shirokovskiy
34a6e84748 virsh: add --keep-nvram option to undefine command
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2016-09-13 09:31:50 +02:00
Christophe Fergeau
184654117e virsh: Fix *-event error string
When using
virsh net-event non-existing-net
the error message says that 'either --list or event type is required'
This is misleading as 'virsh net-event $valid-event-type' is not going
to work either. What is expected is 'virsh net-event --event
$valid-event-type'

This commit fixes the string in pool-event, nodedev-event, event, and
net-event.
2016-09-08 09:54:12 +02:00
Kothapally Madhu Pavan
04597a7038 Make --postcopy flag mandatory with --postcopy-after-precopy
--postcopy-after-precopy is just an aditional flag for
postcopy migration.

Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
2016-09-02 14:42:53 +02:00
Kothapally Madhu Pavan
67af358d11 Check for --live flag for postcopy-after-precopy migration
Unlike postcopy migration there is no --live flag check for
postcopy-after-precopy.

Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
2016-08-26 21:38:11 +02:00
Peter Krempa
64f26276bf virsh: vcpuinfo: Report vcpu number from the structure rather than it's position
virVcpuInfo contains the vcpu number that the data refers to. Report
what's returned by the daemon rather than the sequence number as with
sparse vcpu topologies they won't match.
2016-08-26 11:23:00 -04:00
Pino Toscano
4362ff4337 virsh: use vshError consistently after virBufferError checks
If virBufferError() reports an error, then vshError() is needed to
report the error situation instead of a simple vshError().
2016-08-24 17:43:29 +02:00
Pino Toscano
b620bdee14 virsh: respect -q/--quiet more
Turn various vshPrint() informative messages into vshPrintExtra(), so
they are not printed when requesting the quiet mode; neither XML/info
outputs nor the results of commands are affected.
Also change the expected outputs of the virsh-undefine test, since virsh
is invoked in quiet mode there.

Some informative messages might still be converted (and thus silenced
when in quiet mode), but this is an improvements nonetheless.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1358179
2016-08-24 17:43:29 +02:00
Peter Krempa
8dbc95cbd1 virsh: qemu-monitor-command: Don't print extra newline with --pretty
The prettified JSON string already contains a newline so don't print
another one. This allows to pipe the json output (in conjunction with
the --quiet option) to files without having to truncate them afterwards.
2016-08-02 16:21:53 +02:00
Peter Krempa
8941c800ec virsh: qemu-monitor-command: Simplify control flow
Construct the query string by using virBufferTrim rather than having to
remember to add a space and simplify cleanup path.
2016-08-02 13:59:27 +02:00
Peter Krempa
36428fa80b virsh: qemu-monitor-command: Use macro for exclusive options 2016-08-02 13:55:47 +02:00
Jiri Denemark
d85c3a5451 Report auto convergence throttle rate in migration stats
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-22 15:54:21 +02:00
Jiri Denemark
f6e12b4029 Add auto convergence migration parameters
They can be used to tune auto-convergence algorithm (which is enabled
with VIR_MIGRATE_AUTO_CONVERGE).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-22 15:54:21 +02:00
Peter Krempa
69e0cd3397 virsh: Add command 'guestvcpus' implementing virDomain(GS)etGuestVcpus
Add a straightforward implementation for using the new APIs.
2016-06-22 09:26:08 +02:00
Jiri Denemark
c61360e15b virsh migrate: Fix positional parameters
Thanks to our smart option parser which automatically assigns positional
parameters the following (previously working) command fails:

    virsh migrate test qemu+ssh://1.2.3.4/system tcp://1.2.3.4/
    error: invalid argument: Unsupported compression method
    'tcp://1.2.3.4/'

We need to make sure new options are added at the end of the list rather
than where they logically belong.

Reported by Brian Rak.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-21 10:11:03 +02:00
Ján Tomko
ff52e9d43a Remove separator argument from virBitmapParse
Most the callers pass 0 in one form or another, including
vircapstest which used VIR_ARCH_NONE.
2016-06-20 12:09:52 +02:00
Daniel P. Berrange
291e1a470c virsh: make lxc-enter-namespace also join the cgroups
Extend the lxc-enter-namespace command so that it joins the
containers' cgroups before starting new namespaces. This
ensures that the commands run have the normal resource
limits applied

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-06-10 11:03:01 +01:00
Pavel Hrdina
b1f6792cb6 virsh-domain: fix memory leak in cmdDomDisplay
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-09 09:14:32 +02:00
Pavel Hrdina
4ddde38e2d virsh: domdisplay: if listen is 0.0.0.0 or [::] print address from URI
Currently if a guest has listen address 0.0.0.0 or [::] and you run
"virsh domdisplay $domain" you always get "spice://localhost:$port".

We want to print better address if someone is connected from a different
computer using "virsh -c qemu+ssh://some.host/system".  This patch fixes the
behavior of virsh to print in this case "spice://some.host:$port".

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1332446

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-08 13:54:25 +02:00
Nishith Shah
161713436e virsh: blkdeviotune: accept human readable values for bytes
https://bugzilla.redhat.com/show_bug.cgi?id=885380

Use vshCommandOptScaledInt instead of vshCommandOptULongLong so that
values with suffixes can be passed when bytes are being passed along.
Values for the iops parameters still need to be given in the absolute
form as they are not bytes but numbers.

Signed-off-by: Nishith Shah <nishithshah.2211@gmail.com>
2016-05-09 07:48:08 +02:00
Nitesh Konkar
aaf3ebf760 virsh: Pass the correct live/config xml to virshDomainDetachInterface.
cmdDetachInterface function checks for live config
flags and then passes the live/config domain xml
to virshDomainDetachInterface accordingly.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2016-05-04 11:33:22 -04:00
Nitesh Konkar
6289cebf40 virsh: Introduce virshDomainDetachInterface function
virshDomainDetachInterface handles virsh interface
detach from the specified live/config domain xml.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2016-05-04 11:30:46 -04:00
Yuri Chornoivan
50fc4b4bdd Fix minor typos in messages
Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2016-04-30 15:37:31 +02:00
Peter Krempa
b4bc800cfc virsh: perf: Remove unnecessary 'error' label
The only place that uses it doesn't warrant a separate label.
2016-04-21 09:57:02 +02:00
Peter Krempa
f4f916a9e3 virsh: perf: Don't leak domain
After failing to parse the perf event list, the code would return
failure without freeing the previously acquired object. Rearrange the
code to avoid the problem.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1329046
2016-04-21 09:57:02 +02:00
Nitesh Konkar
0ed35e0939 Return error when --start <number> in cpu-stats is invalid.
Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
2016-04-15 15:20:11 +02:00
ShaoHe Feng
0d81f2318b virsh: add compression options for migration
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2016-04-14 14:57:42 +02:00
Peter Krempa
5be120710e Add VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED event
Since we didn't opt to use one single event for device lifecycle for a
VM we are missing one last event if the device removal failed. This
event will be emitted once we asked to eject the device but for some
reason it is not possible.
2016-04-13 13:26:29 +02:00
Nitesh Konkar
d9a0a885e2 Pass the correct cpu count when calling virDomainGetCPUStats.
When using the --start option, the show_count should not be set to
max_id as the --start <cpu> means we dont need those many initial cpu
stats. Hence, show_count should be adjusted accordingly.

https://bugzilla.redhat.com/show_bug.cgi?id=1249441

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2016-04-01 11:36:04 +02:00
Michal Privoznik
ed504ba392 virDomain{Get,Set}PerfEvents: support --config --live --current
Now that we have @flags we can support changing perf events just
in active or inactive configuration regardless of the other.
Previously, calling virDomainSetPerfEvents set events in both
active and inactive configuration at once. Even though we allow
users to set perf events that are to be enabled once domain is
started up. The virDomainGetPerfEvents API was flawed too. It
returned just runtime info.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-03-31 10:42:46 +02:00
Michal Privoznik
30cd5983b7 virsh: Make perf accept event list separated by commas
Everywhere else we use a comma separated list. There's no good
reason to make 'perf' command an exception. Currently, it accepts
string list separated by '|'.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-03-31 10:22:14 +02:00
Michal Privoznik
ee34745f6a virsh: Prefer VIRSH_COMMON_OPT_DOMAIN_FULL over full enumeration
We have a macro that does exactly what is done via full
enumeration.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-03-31 07:24:36 +02:00
Michal Privoznik
3b6c818532 virDomain{Get,Set}PerfEvents: Add @flags argument
I've noticed that these APIs are missing @flags argument. Even
though we don't have a use for them, it's our policy that every
new API must have @flags.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-03-31 07:24:36 +02:00
Peter Krempa
d40d18fb8f virsh: blockpull: Support --bytes and scaled integers
Use vshBlockJobOptionBandwidth to parse the bandwidth value which will
allow users to specify bandwidth in bytes or as a scaled integer.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1288000
2016-03-29 15:59:19 +02:00
Peter Krempa
453a6d8092 virsh: blockcopy: Support --bytes and scaled integers
Use vshBlockJobOptionBandwidth to parse the bandwidth value which will
allow users to specify bandwidth in bytes or as a scaled integer.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1288000
2016-03-29 15:58:41 +02:00
Peter Krempa
e557bd28a2 virsh: blockcommit: Support --bytes and scaled integers
Use vshBlockJobOptionBandwidth to parse the bandwidth value which will
allow users to specify bandwidth in bytes or as a scaled integer.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1288000
2016-03-29 15:55:28 +02:00
Peter Krempa
e54b5484c9 virsh: blockjob: Support --bytes and scaled integers as bandwidth
Use vshBlockJobOptionBandwidth to parse the bandwidth value which will
allow users to specify bandwidth in bytes or as a scaled integer.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1288000
2016-03-29 15:52:10 +02:00
Qiaowei Ren
608e9e8802 virsh: implement new command to support perf
This patch add new perf command to enable/disable perf event
for a guest domain.

Signed-off-by: Qiaowei Ren <qiaowei.ren@intel.com>
Message-id: 1459171833-26416-8-git-send-email-qiaowei.ren@intel.com
2016-03-29 13:13:05 +01:00
Cristian Klein
4cdc4a76d3 virsh: Add --postcopy-after-precopy option to migrate
Signed-off-by: Cristian Klein <cristiklein@gmail.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-03-21 15:15:46 +01:00
Jiri Denemark
257060349e virsh: Configurable migrate --timeout action
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-03-21 15:15:46 +01:00
Cristian Klein
179d97283f virsh: Add support for post-copy migration
Signed-off-by: Cristian Klein <cristiklein@gmail.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-03-21 15:15:46 +01:00
Jiri Denemark
5a9cbc6265 Add event and state details for post-copy
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY and VIR_DOMAIN_PAUSED_POSTCOPY are
used on the source host once migration enters post-copy mode (which
means the domain gets paused on the source. After the destination host
takes over the execution of the domain, its virtual CPUs are resumed and
the domain enters VIR_DOMAIN_RUNNING_POSTCOPY state and
VIR_DOMAIN_EVENT_RESUMED_POSTCOPY event is emitted.

In case migration fails during post-copy mode and none of the hosts have
complete state of the domain, both domains will remain paused with
VIR_DOMAIN_PAUSED_POSTCOPY_FAILED reason and an upper layer may decide
what to do.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-03-21 15:15:46 +01:00
Nikolay Shirokovskiy
f486cb5ea0 migration: add target peer disks port
Some hypervisors (namely qemu) can have a separate connecton for
non-shared disks migration of active domains. Currently we have
no means to control the port of such a connection. At the same
time we have options to control port of memory migration traffic
(thru migration uri) as well as interfaces that target server
is bound to for incoming migration (thru VIR_MIGRATE_PARAM_LISTEN_ADDRESS).
Let's add the option for setting disks port too.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2016-03-17 16:20:15 +01:00
Dmitry Andreev
8047d45704 Introduce new VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT sub-event
VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT event should be emitted
when domain configuration was changed on revert to snapshot.
2016-03-15 14:57:26 -04:00
Peter Krempa
e7e6980dd8 virsh: vcpupin: Ask for pinning info for all vCPUs
The API docs state that the API queries pinning info for all vCPUs and
thus we should allocate the bitmap even for the inactive ones.

The API will currently return bitmap only for the active vCPUs but that
will change in the future.
2016-03-09 10:09:16 +01:00
Jiri Denemark
f289300181 Introduce job completed event
The VIR_DOMAIN_EVENT_ID_JOB_COMPLETED event will be triggered once a job
(such as migration) finishes and it will contain statistics for the job
as one would get by calling virDomainGetJobStats. Thanks to this event
it is now possible to get statistics of a completed migration of a
transient domain on the source host.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-03-08 16:26:00 +01:00
Nitesh Konkar
2652757070 virsh: reject migration with both --live and --offline
Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2016-02-26 12:45:20 +01:00
Michal Privoznik
4a3ae388ba cmdSaveImageEdit: Prefer VSH_EXCLUSIVE_OPTIONS over by hand check
Since we have the macro there's no need for us to unwind it by
hand and check for mutually exclusive flags ourselves.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-02-22 16:56:07 +01:00
Peter Krempa
773f3bd3cc virsh: cpupin: Extract getter code into a separate function 2016-02-19 15:24:54 +01:00
Peter Krempa
a7bc9841a4 virsh: cmdVcpuPin: Simplify handling of API flags
Rather than setting flags to -1 if none were specified, move the logic
to use the old API to the place where we need to decide. It simplifies
the logic a bit.
2016-02-19 15:13:21 +01:00