From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKoKA-0004h8-HT for qemu-devel@nongnu.org; Tue, 04 Mar 2014 07:20:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKoK2-0004Qv-4d for qemu-devel@nongnu.org; Tue, 04 Mar 2014 07:19:54 -0500 Received: from mail-pb0-x22f.google.com ([2607:f8b0:400e:c01::22f]:61852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKoK1-0004Qp-S3 for qemu-devel@nongnu.org; Tue, 04 Mar 2014 07:19:46 -0500 Received: by mail-pb0-f47.google.com with SMTP id up15so5148719pbc.34 for ; Tue, 04 Mar 2014 04:19:44 -0800 (PST) Message-ID: <5315C4D4.4080102@gmail.com> Date: Tue, 04 Mar 2014 20:19:32 +0800 From: Xuebing wang MIME-Version: 1.0 References: <1393901250-3922-1-git-send-email-xbing6@gmail.com> <1393901250-3922-3-git-send-email-xbing6@gmail.com> <5315A89F.40700@redhat.com> In-Reply-To: <5315A89F.40700@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Discussion 02/10] NEED_CPU_H: remove '#include "cpu.h"' from include/qemu-common.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: afaerber@suse.de, stefanha@redhat.com >> index 367eda1..f0157e3 100644 >> --- a/include/qom/cpu.h >> +++ b/include/qom/cpu.h >> @@ -510,18 +510,4 @@ void qemu_init_vcpu(CPUState *cpu); >> */ >> void cpu_single_step(CPUState *cpu, int enabled); >> >> -#ifdef CONFIG_SOFTMMU >> -extern const struct VMStateDescription vmstate_cpu_common; >> -#else >> -#define vmstate_cpu_common vmstate_dummy >> -#endif >> - >> -#define VMSTATE_CPU() >> { \ >> - .name = "parent_obj", \ >> - .size = sizeof(CPUState), \ >> - .vmsd = &vmstate_cpu_common, \ >> - .flags = >> VMS_STRUCT, \ >> - .offset = >> 0, \ >> -} >> - > > Like Andreas I don't like this particularly. You can add > migration/vmstate.h to qom/cpu.h instead. > In my humble opinion, qom/cpu is part of virtual machine along with other hw peripherals, thus I'd prefer vmstate to depend on qom/cpu. From object oriented design perspective, qom/cpu is one-level lower than the modeling of virtual machine, do you agree?