[libvirt] [PATCH 3/3] setvcpus: add "--current" option to "virsh setvcpus"

Eric Blake eblake at redhat.com
Fri Jul 15 14:31:26 UTC 2011

On 07/15/2011 01:02 AM, Taku Izumi wrote:
> This patch adds the --current option to "virsh setvcpus"
> command. Currently "virsh setvcpus" command supports
> "--live" and "--config" , but "--current" option.
>>From view of consistency, it's reasonable to support
> "--current" option too.
> When --current is specified, it affects a "current" 
> domain.
> Signed-off-by: Taku Izumi <izumi.taku at jp.fujitsu.com>
> ---
>  tools/virsh.c   |   26 ++++++++++++++++++++++----
>  tools/virsh.pod |    6 ++++--
>  2 files changed, 26 insertions(+), 6 deletions(-)

> @@ -3294,6 +3310,8 @@ cmdSetvcpus(vshControl *ctl, const vshCm
>          if (maximum) {
>              vshDebug(ctl, VSH_ERR_DEBUG, "--maximum flag was given\n");
> +            flags |= VIR_DOMAIN_VCPU_MAXIMUM;

This is a bit separated from the rest of flags settings, so it took me
two reads to make sure you didn't lose the bit, but your logic is valid.
 So no changes needed.

>  =item B<setvcpus> I<domain-id> I<count> optional I<--maximum> I<--config>
> -I<--live>
> +I<--live> I<--current>

Oh fun - merge conflict with my patch to tweak the use of "optional" in

>  Change the number of virtual CPUs active in a guest domain.  By default,
>  this command works on active guest domains.  To change the settings for an
> @@ -758,7 +758,9 @@ If I<--live> is specified, the guest dom
>  takes place immediately.  Both the I<--config> and I<--live> flags may be
>  specified together if supported by the hypervisor.
> -When neither the I<--config> nor I<--live> flags are given, the I<--live>
> +If I<--current> is specified, affect the current guest state.
> +
> +When neither flags are given, the I<--live>


>  flag is assumed and the guest domain must be active.  In this situation it
>  is up to the hypervisor whether the I<--config> flag is also assumed, and
>  therefore whether the XML configuration is adjusted to make the change

ACK with the one word nit fixed, so series pushed.

Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110715/82534bbf/attachment-0001.sig>

More information about the libvir-list mailing list