From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQGiI-000638-99 for qemu-devel@nongnu.org; Thu, 11 Apr 2013 08:34:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQGiH-0002nq-2b for qemu-devel@nongnu.org; Thu, 11 Apr 2013 08:34:50 -0400 Received: from mail-qc0-x22d.google.com ([2607:f8b0:400d:c01::22d]:34582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQGiG-0002nm-UI for qemu-devel@nongnu.org; Thu, 11 Apr 2013 08:34:48 -0400 Received: by mail-qc0-f173.google.com with SMTP id b12so660641qca.18 for ; Thu, 11 Apr 2013 05:34:48 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5166ADE2.6070004@redhat.com> Date: Thu, 11 Apr 2013 14:34:42 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1365682468-12301-1-git-send-email-benoit@irqsave.net> <1365682468-12301-2-git-send-email-benoit@irqsave.net> In-Reply-To: <1365682468-12301-2-git-send-email-benoit@irqsave.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 1/4] migration: Create the pre migration flush hook infrastructure. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= Cc: quintela@redhat.com, qemu-devel@nongnu.org, aneesh.kumar@linux.vnet.ibm.com Il 11/04/2013 14:14, Benoît Canet ha scritto: > diff --git a/include/migration/migration-flush-hooks.h b/include/migration/migration-flush-hooks.h > new file mode 100644 > index 0000000..be9e597 > --- /dev/null > +++ b/include/migration/migration-flush-hooks.h > @@ -0,0 +1,30 @@ > +/* > + * QEMU live pre migration flush hooks > + * > + * Copyright Nodalink, SARL. 2013 > + * > + * Authors: > + * Benoît Canet > + * > + * This work is licensed under the terms of the GNU GPL, version 2 or later. > + * See the COPYING file in the top-level directory. > + * > + */ > + > +#ifndef QEMU_MIGRATION_FLUSH_HOOKS_H > +#define QEMU_MIGRATION_FLUSH_HOOKS_H > + > +#include "qemu/queue.h" > + > +typedef struct MigrationFlushHookEntry { > + void (*flush_hook)(void); > + QTAILQ_ENTRY(MigrationFlushHookEntry) node; > +} MigrationFlushHookEntry; > + > +void init_migration_flush_hooks(void); > + > +void register_migration_flush_hook(void (*fn)(void)); > + > +void exec_migration_flush_hooks(void); Note that the point where you execute this (do_vm_stop) is not just for migration. So, can you just use a VMState change notifier? If not, please make this a Notifier instead of using your own data structure. Paolo > +#endif