Received: from eggs.gnu.org ([208.118.235.92]:47107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUck0-0005u2-UC for qemu-devel@nongnu.org; Tue, 23 Apr 2013 08:54:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUcjw-0006gd-6o for qemu-devel@nongnu.org; Tue, 23 Apr 2013 08:54:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58535) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUcjv-0006eK-VI for qemu-devel@nongnu.org; Tue, 23 Apr 2013 08:54:32 -0400 Date: Tue, 23 Apr 2013 14:54:16 +0200 From: Igor Mammedov Message-ID: <20130423145416.0253832c@nial.usersys.redhat.com> In-Reply-To: <877gjtwk7x.fsf@elfo.elfo> References: <1366705795-24732-1-git-send-email-imammedo@redhat.com> <1366705795-24732-11-git-send-email-imammedo@redhat.com> <877gjtwk7x.fsf@elfo.elfo> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 10/21] acpi_piix4: add infrastructure to send CPU hot-plug GPE to guest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: quintela@redhat.com 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, stefano.stabellini@eu.citrix.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, afaerber@suse.de, armbru@redhat.com, rth@twiddle.net On Tue, 23 Apr 2013 13:38:10 +0200 Juan Quintela wrote: > Igor Mammedov wrote: > > > > > +#define VMSTATE_CPU_STATUS_ARRAY(_field, > > _state) \ > > + > > { \ > > + .name = > > (stringify(_field)), \ > > + .version_id = 0, > > \ > > this line should be: > .version_id = 4, > > > > + .num = > > PIIX4_PROC_LEN, \ > > + .info = > > &vmstate_info_uint8, \ > > + .size = > > sizeof(uint8_t), \ > > + .flags = > > VMS_ARRAY, \ > > + .offset = vmstate_offset_array(_state, _field, > > uint8_t, \ > > + > > PIIX4_PROC_LEN), \ > > + } > > + > > /* qemu-kvm 1.2 uses version 3 but advertised as 2 > > * To support incoming qemu-kvm 1.2 migration, change version_id > > * and minimum_version_id to 2 below (which breaks migration from > > > @@ -265,7 +289,7 @@ static int acpi_load_old(QEMUFile *f, void *opaque, > > int version_id) */ > > static const VMStateDescription vmstate_acpi = { > > .name = "piix4_pm", > > - .version_id = 3, > > + .version_id = 4, > > .minimum_version_id = 3, > > .minimum_version_id_old = 1, > > .load_state_old = acpi_load_old, > > @@ -281,6 +305,7 @@ static const VMStateDescription vmstate_acpi = { > > VMSTATE_STRUCT(ar.gpe, PIIX4PMState, 2, vmstate_gpe, ACPIGPE), > > VMSTATE_STRUCT(pci0_status, PIIX4PMState, 2, vmstate_pci_status, > > struct pci_status), > > + VMSTATE_CPU_STATUS_ARRAY(gpe_cpu.sts, PIIX4PMState), > > It is more, I think that simply: > > VMSTATE_UINT8_ARRAY_V(gpu_cpu.sts, PIIX4PMstate, PIIX4_PROC_LEN, 4); > > Should do the trick without the previous blob (it was needed for the old > version because we have a uint32 data but we send a uint16 one). > > Could you check? I don't have an easy way to test that it "receives" > the right value. Just checked, it works with VMSTATE_UINT8_ARRAY_V as well, but I have a question, why version should be 4, looking at git history components of vmstate_acpi don't advance their version each time vmstate_acpi change, they do it only when they themselves change. > > Later, Juan. > > > VMSTATE_END_OF_LIST() > > } > > }; > > @@ -585,6 +610,85 @@ static const MemoryRegionOps piix4_pci_ops = { >