Re: [PATCH 7/7] qemu: Implement virDomainSetGuestVcpus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 20, 2016 at 04:34:21PM +0200, Peter Krempa wrote:
> Allow modification of specific vCPU states via the guest agent.
> ---
>  src/qemu/qemu_driver.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 83 insertions(+)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 5b96ad8..4bd8c92 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -19837,6 +19837,88 @@ qemuDomainGetGuestVcpus(virDomainPtr dom,
>  }
> 
> 
> +static int
> +qemuDomainSetGuestVcpus(virDomainPtr dom,
> +                        const char *cpumap,
> +                        int state,
> +                        unsigned int flags)
> +{
> +    virQEMUDriverPtr driver = dom->conn->privateData;
> +    virDomainObjPtr vm = NULL;
> +    virBitmapPtr map = NULL;
> +    qemuAgentCPUInfoPtr info = NULL;
> +    int ninfo = 0;
> +    size_t i;
> +    int ret = -1;
> +
> +    virCheckFlags(0, -1);
> +
> +    if (state != 0 && state != 1) {
> +        virReportInvalidArg(state, "%s", _("unsupported state value"));
> +        return -1;
> +    }
> +
> +    if (virBitmapParse(cpumap, &map, 4096) < 0)
> +        goto cleanup;

s/4096/QEMU_GUEST_VCPU_MAX_ID/

> +
> +    if (!(vm = qemuDomObjFromDomain(dom)))
> +        goto cleanup;
> +
> +    if (virDomainSetGuestVcpusEnsureACL(dom->conn, vm->def) < 0)
> +        goto cleanup;
> +
> +    if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
> +        goto cleanup;
> +
> +    if (!qemuDomainAgentAvailable(vm, true))
> +        goto endjob;

[...]

ACK

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]