From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV2w2-0001rh-AO for qemu-devel@nongnu.org; Wed, 24 Apr 2013 12:52:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UV2vw-0008Oj-VY for qemu-devel@nongnu.org; Wed, 24 Apr 2013 12:52:46 -0400 Received: from cantor2.suse.de ([195.135.220.15]:51475 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV2vw-0008O5-MH for qemu-devel@nongnu.org; Wed, 24 Apr 2013 12:52:40 -0400 Message-ID: <51780DD4.8070101@suse.de> Date: Wed, 24 Apr 2013 18:52:36 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1366705795-24732-1-git-send-email-imammedo@redhat.com> <1366705795-24732-6-git-send-email-imammedo@redhat.com> In-Reply-To: <1366705795-24732-6-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 05/21] introduce CPU hot-plug notifier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@us.ibm.com, ehabkost@redhat.com, gleb@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, quintela@redhat.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, aderumier@odiso.com, lcapitulino@redhat.com, blauwirbel@gmail.com, anthony.perard@citrix.com, alex.williamson@redhat.com, kraxel@redhat.com, yang.z.zhang@intel.com, pbonzini@redhat.com, stefano.stabellini@eu.citrix.com, armbru@redhat.com, rth@twiddle.net Am 23.04.2013 10:29, schrieb Igor Mammedov: > hot-add CPU event will be distributed to acpi_piix4 and rtc_cmos >=20 > Signed-off-by: Igor Mammedov > --- > v3: > * call notifier right before CPU becomes runable > v2: > * move notifier to qom/cpu.c and call it from CPUClass.realize() on h= otplug > * remove get_firmware_id() since it belong to other patch > --- > include/sysemu/sysemu.h | 3 +++ > qom/cpu.c | 12 ++++++++++++ > 2 files changed, 15 insertions(+), 0 deletions(-) Thanks, applied to qom-cpu: https://github.com/afaerber/qemu-cpu/commits/qom-cpu One comment below... >=20 > diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h > index 6578782..a8c3de1 100644 > --- a/include/sysemu/sysemu.h > +++ b/include/sysemu/sysemu.h > @@ -152,6 +152,9 @@ void do_pci_device_hot_remove(Monitor *mon, const Q= Dict *qdict); > /* generic hotplug */ > void drive_hot_add(Monitor *mon, const QDict *qdict); > =20 > +/* CPU hotplug */ > +void qemu_register_cpu_added_notifier(Notifier *notifier); Would be nice to turn this into a gtk-doc comment explaining when the notification is fired, as a follow-up. Andreas > + > /* pcie aer error injection */ > void pcie_aer_inject_error_print(Monitor *mon, const QObject *data); > int do_pcie_aer_inject_error(Monitor *mon, > diff --git a/qom/cpu.c b/qom/cpu.c > index abb20d0..9f78114 100644 > --- a/qom/cpu.c > +++ b/qom/cpu.c > @@ -21,6 +21,17 @@ > #include "qom/cpu.h" > #include "qemu-common.h" > #include "sysemu/kvm.h" > +#include "qemu/notify.h" > +#include "sysemu/sysemu.h" > + > +/* CPU hot-plug notifiers */ > +static NotifierList cpu_added_notifiers =3D > + NOTIFIER_LIST_INITIALIZER(cpu_add_notifiers); > + > +void qemu_register_cpu_added_notifier(Notifier *notifier) > +{ > + notifier_list_add(&cpu_added_notifiers, notifier); > +} > =20 > void cpu_reset_interrupt(CPUState *cpu, int mask) > { > @@ -60,6 +71,7 @@ static void cpu_common_realizefn(DeviceState *dev, Er= ror **errp) > { > if (dev->hotplugged) { > cpu_synchronize_post_init(CPU(dev)); > + notifier_list_notify(&cpu_added_notifiers, dev); > cpu_resume(CPU(dev)); > } > } >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg