From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ub9yu-00076v-A0 for qemu-devel@nongnu.org; Sat, 11 May 2013 09:37:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ub9yt-0002Le-3R for qemu-devel@nongnu.org; Sat, 11 May 2013 09:37:00 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59869 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ub9ys-0002LM-QC for qemu-devel@nongnu.org; Sat, 11 May 2013 09:36:59 -0400 Message-ID: <518E4973.40409@suse.de> Date: Sat, 11 May 2013 15:36:51 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1367911007-13990-1-git-send-email-qiaonuohan@cn.fujitsu.com> <1367911007-13990-4-git-send-email-qiaonuohan@cn.fujitsu.com> In-Reply-To: <1367911007-13990-4-git-send-email-qiaonuohan@cn.fujitsu.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/9] Move include and struct definition to dump.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Qiao Nuohan Cc: qemu-devel@nongnu.org, Eduardo Habkost Am 07.05.2013 09:16, schrieb Qiao Nuohan: > Move includes and definition of struct DumpState into include/sysemu/du= mp.h. >=20 > Signed-off-by: Qiao Nuohan > Reviewed-by: Zhang Xiaohe > --- > dump.c | 30 ------------------------------ > include/sysemu/dump.h | 31 +++++++++++++++++++++++++++++++ > 2 files changed, 31 insertions(+), 30 deletions(-) >=20 > diff --git a/dump.c b/dump.c > index c0d3da5..3785a68 100644 > --- a/dump.c > +++ b/dump.c > @@ -11,18 +11,7 @@ > * > */ > =20 > -#include "qemu-common.h" > -#include "elf.h" > -#include "cpu.h" > -#include "exec/cpu-all.h" > -#include "exec/hwaddr.h" > -#include "monitor/monitor.h" > -#include "sysemu/kvm.h" > #include "sysemu/dump.h" > -#include "sysemu/sysemu.h" > -#include "sysemu/memory_mapping.h" > -#include "qapi/error.h" > -#include "qmp-commands.h" > =20 > static uint16_t cpu_convert_to_target16(uint16_t val, int endian) > { > @@ -57,25 +46,6 @@ static uint64_t cpu_convert_to_target64(uint64_t val= , int endian) > return val; > } > =20 > -typedef struct DumpState { > - ArchDumpInfo dump_info; > - MemoryMappingList list; > - uint16_t phdr_num; > - uint32_t sh_info; > - bool have_section; > - bool resume; > - size_t note_size; > - hwaddr memory_offset; > - int fd; > - > - RAMBlock *block; > - ram_addr_t start; > - bool has_filter; > - int64_t begin; > - int64_t length; > - Error **errp; > -} DumpState; > - > static int dump_cleanup(DumpState *s) > { > int ret =3D 0; > diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h > index b8c770f..c4c90c4 100644 > --- a/include/sysemu/dump.h > +++ b/include/sysemu/dump.h > @@ -14,12 +14,43 @@ > #ifndef DUMP_H > #define DUMP_H > =20 > +#include "qemu-common.h" Please place only the needed includes in a header, not qemu-common.h. This avoids circular includes and resulting problems. Regards, Andreas > +#include "elf.h" > +#include "cpu.h" > +#include "exec/cpu-all.h" > +#include "exec/hwaddr.h" > +#include "monitor/monitor.h" > +#include "sysemu/kvm.h" > +#include "sysemu/sysemu.h" > +#include "sysemu/memory_mapping.h" > +#include "qapi/error.h" > +#include "qmp-commands.h" > + > typedef struct ArchDumpInfo { > int d_machine; /* Architecture */ > int d_endian; /* ELFDATA2LSB or ELFDATA2MSB */ > int d_class; /* ELFCLASS32 or ELFCLASS64 */ > } ArchDumpInfo; > =20 > +typedef struct DumpState { > + ArchDumpInfo dump_info; > + MemoryMappingList list; > + uint16_t phdr_num; > + uint32_t sh_info; > + bool have_section; > + bool resume; > + size_t note_size; > + hwaddr memory_offset; > + int fd; > + > + RAMBlock *block; > + ram_addr_t start; > + bool has_filter; > + int64_t begin; > + int64_t length; > + Error **errp; > +} DumpState; > + > int cpu_get_dump_info(ArchDumpInfo *info); > ssize_t cpu_get_note_size(int class, int machine, int nr_cpus); > =20 >=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