From patchwork Tue Dec 4 13:19:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 203624 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8E0D42C0090 for ; Wed, 5 Dec 2012 00:19:06 +1100 (EST) Received: from localhost ([::1]:40773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfsOu-0008Sy-I4 for incoming@patchwork.ozlabs.org; Tue, 04 Dec 2012 08:19:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfsO5-0007Zy-27 for qemu-devel@nongnu.org; Tue, 04 Dec 2012 08:18:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfsO3-0000JO-Ub for qemu-devel@nongnu.org; Tue, 04 Dec 2012 08:18:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfsO3-0000Il-KN for qemu-devel@nongnu.org; Tue, 04 Dec 2012 08:18:11 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qB4DI9EP003463 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 4 Dec 2012 08:18:09 -0500 Received: from blackpad.lan.raisama.net (vpn1-5-217.gru2.redhat.com [10.97.5.217]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qB4DI8we027985; Tue, 4 Dec 2012 08:18:09 -0500 Received: by blackpad.lan.raisama.net (Postfix, from userid 500) id 0E0BF200DA0; Tue, 4 Dec 2012 11:19:45 -0200 (BRST) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Tue, 4 Dec 2012 11:19:36 -0200 Message-Id: <1354627180-25704-5-git-send-email-ehabkost@redhat.com> In-Reply-To: <1354627180-25704-1-git-send-email-ehabkost@redhat.com> References: <1354627180-25704-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Anthony Liguori , Paolo Bonzini Subject: [Qemu-devel] [RFC 4/8] libqemustub: vmstate register/unregister stubs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add vmstate stub functions, so that qdev.o can be used without savevm.o when vmstate support is not necessary (i.e. by *-user). Signed-off-by: Eduardo Habkost --- Originally submitted as: Subject: qdev-core: isolate vmstate handling into separate functions Changes v1 -> v2: - Add GCC_WEAK_DECL to function declarations Changes v2 -> v3: - Subject: qdev: add weak aliases for vmstate handling on qdev.c - Make vmstate_register_with_alias_id()/vmstate_unregister() have GCC_WEAK versions, instead of creating a new function - Kept qdev_get_vmsd() inside qdev.c Changss v3 -> v4: - Use the new QEMU_WEAK_ALIAS system instead of GCC_WEAK Changes v4 -> v5: - Use the new libqemustub.a, instead of QEMU_WEAK_ALIAS Changes v5 -> v6: - Cosmetic whitespace changes --- stubs/Makefile.objs | 1 + stubs/vmstate.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 stubs/vmstate.c diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 00f0b64..ca2197e 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -6,4 +6,5 @@ stub-obj-y += fdset-remove-fd.o stub-obj-y += get-fd.o stub-obj-y += set-fd-handler.o stub-obj-y += reset.o +stub-obj-y += vmstate.o stub-obj-$(CONFIG_WIN32) += fd-register.o diff --git a/stubs/vmstate.c b/stubs/vmstate.c new file mode 100644 index 0000000..badf79e --- /dev/null +++ b/stubs/vmstate.c @@ -0,0 +1,17 @@ +#include "qemu-common.h" +#include "vmstate.h" + +int vmstate_register_with_alias_id(DeviceState *dev, + int instance_id, + const VMStateDescription *vmsd, + void *base, int alias_id, + int required_for_version) +{ + return 0; +} + +void vmstate_unregister(DeviceState *dev, + const VMStateDescription *vmsd, + void *opaque) +{ +}