From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbmKm-0001TO-No for qemu-devel@nongnu.org; Wed, 08 Oct 2014 04:11:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbmKh-000360-R5 for qemu-devel@nongnu.org; Wed, 08 Oct 2014 04:10:56 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:35640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbmKh-00032I-2K for qemu-devel@nongnu.org; Wed, 08 Oct 2014 04:10:51 -0400 Message-ID: <5434F179.7030405@huawei.com> Date: Wed, 8 Oct 2014 16:10:33 +0800 From: zhanghailiang MIME-Version: 1.0 References: <1412358473-31398-1-git-send-email-dgilbert@redhat.com> <1412358473-31398-37-git-send-email-dgilbert@redhat.com> <5434A203.8080000@huawei.com> <20141008074950.GA2521@work-vm> In-Reply-To: <20141008074950.GA2521@work-vm> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 36/47] Page request: Process incoming page request List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, lilei@linux.vnet.ibm.com, quintela@redhat.com, cristian.klein@cs.umu.se, qemu-devel@nongnu.org, amit.shah@redhat.com, yanghy@cn.fujitsu.com On 2014/10/8 15:49, Dr. David Alan Gilbert wrote: > * zhanghailiang (zhang.zhanghailiang@huawei.com) wrote: > >>> typedef struct Visitor Visitor; >>> @@ -80,6 +81,6 @@ typedef struct FWCfgState FWCfgState; >>> typedef struct PcGuestInfo PcGuestInfo; >>> typedef struct PostcopyPMI PostcopyPMI; >>> typedef struct Range Range; >>> -typedef struct AdapterInfo AdapterInfo; >>> +typedef struct RAMBlock RAMBlock; >>> >> >> :(, another redefinition, 'RAMBlock' also defined in 'include/exec/cpu-all.h:314', >> Am i miss something when compile qemu? > > Interesting; I'm not seeing that problem at all (gcc 4.8.3-7) > > What compiler and flags are you using? > > Dave > Hi Dave, My compiler info: gcc (SUSE Linux) 4.3.4 The configure info is: #./configure --target-list=x86_64-softmmu --enable-debug --disable-gtk ... CFLAGS -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -g QEMU_CFLAGS -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-all -I/usr/include/libpng12 -I/usr/include/pixman-1 LDFLAGS -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64 -g ... Maybe its gcc's limitation, but why this redefinition need? After i remove one, it compiles successfully;) Thanks, zhanghailiang > >> >>> #endif /* QEMU_TYPEDEFS_H */ >>> diff --git a/migration.c b/migration.c >>> index cfdaa52..63d7699 100644 >>> --- a/migration.c >>> +++ b/migration.c >>> @@ -26,6 +26,8 @@ >>> #include "qemu/thread.h" >>> #include "qmp-commands.h" >>> #include "trace.h" >>> +#include "exec/memory.h" >>> +#include "exec/address-spaces.h" >>> >>> //#define DEBUG_MIGRATION >>> >>> @@ -504,6 +506,15 @@ static void migrate_fd_cleanup(void *opaque) >>> >>> migrate_fd_cleanup_src_rp(s); >>> >>> + /* This queue generally should be empty - but in the case of a failed >>> + * migration might have some droppings in. >>> + */ >>> + struct MigrationSrcPageRequest *mspr, *next_mspr; >>> + QSIMPLEQ_FOREACH_SAFE(mspr, &s->src_page_requests, next_req, next_mspr) { >>> + QSIMPLEQ_REMOVE_HEAD(&s->src_page_requests, next_req); >>> + g_free(mspr); >>> + } >>> + >>> if (s->file) { >>> trace_migrate_fd_cleanup(); >>> qemu_mutex_unlock_iothread(); >>> @@ -610,6 +621,9 @@ MigrationState *migrate_init(const MigrationParams *params) >>> s->state = MIG_STATE_SETUP; >>> trace_migrate_set_state(MIG_STATE_SETUP); >>> >>> + qemu_mutex_init(&s->src_page_req_mutex); >>> + QSIMPLEQ_INIT(&s->src_page_requests); >>> + >>> s->total_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME); >>> return s; >>> } >>> @@ -823,7 +837,25 @@ static void source_return_path_bad(MigrationState *s) >>> static void migrate_handle_rp_reqpages(MigrationState *ms, const char* rbname, >>> ram_addr_t start, ram_addr_t len) >>> { >>> - DPRINTF("migrate_handle_rp_reqpages: at %zx for len %zx", start, len); >>> + DPRINTF("migrate_handle_rp_reqpages: in %s start %zx len %zx", >>> + rbname, start, len); >>> + >>> + /* Round everything up to our host page size */ >>> + long our_host_ps = sysconf(_SC_PAGESIZE); >>> + if (start & (our_host_ps-1)) { >>> + long roundings = start & (our_host_ps-1); >>> + start -= roundings; >>> + len += roundings; >>> + } >>> + if (len & (our_host_ps-1)) { >>> + long roundings = len & (our_host_ps-1); >>> + len -= roundings; >>> + len += our_host_ps; >>> + } >>> + >>> + if (ram_save_queue_pages(ms, rbname, start, len)) { >>> + source_return_path_bad(ms); >>> + } >>> } >>> >>> /* >>> >> >> > -- > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK > > . >