qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] QEMU online/offline cpu


From: Igor Mammedov
Subject: Re: [Qemu-devel] QEMU online/offline cpu
Date: Tue, 3 Jan 2017 12:37:36 +0100

On Mon, 2 Jan 2017 23:27:50 +0300
Ozgur O Kilic <address@hidden> wrote:

> Hi
> 
> I am trying to understand how QEMU threads respond to set a vCPU online or 
> offline. 
> 
> Specifically, what happens to QEMU thread if in the guest, we execute:
> 
> echo 0 > /sys/devices/system/cpu/cpu1/online
> Is the corresponding QEMU thread paused?
on success CPU executes play_dead() and isn't used/scheduled by guest.

However it's still possible to online it back using
echo 1 > /sys/devices/system/cpu/cpu1/online

If you need to prevent that happening you should use QEMU's
device_del command via HMP/QMP interface.
For x86 it would trigger ACPI based CPU hot-unplug action after which
vCPU object in QMEU would be destroyed and corresponding KVM thread
be parked and corresponding CPU object /sys/devices/system/cpu/cpuXX
in guest is removed. To use that CPU again in guest, one should
hotplug it back in QEMU using device_add.

details of ACPI based cpu hot(un)plug qemu<->guest protocol are described in
QEMU/docs/specs/acpi_cpu_hotplug.txt file. x86 ACPI based implementation is
mostly contained in QEMU/hw/acpi/cpu* files.

Wiki page http://wiki.qemu.org/Features/CPUHotplug is rather outdated,
I'll update it to reflect currently implemented hotplug interfaces/targets.

PS:
cpu hot-unplug is recently new feature so one should use recent
qemu/libvirt versions.

> Thank you
> Ozgur Ozan Kilic




reply via email to

[Prev in Thread] Current Thread [Next in Thread]