From patchwork Fri Oct 19 02:42:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 192535 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 222052C007F for ; Fri, 19 Oct 2012 15:12:57 +1100 (EST) Received: from localhost ([::1]:57717 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TP2Yt-0006SW-Lj for incoming@patchwork.ozlabs.org; Thu, 18 Oct 2012 22:43:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TP2Y4-0004YO-5J for qemu-devel@nongnu.org; Thu, 18 Oct 2012 22:42:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TP2Y2-0002wx-UM for qemu-devel@nongnu.org; Thu, 18 Oct 2012 22:42:56 -0400 Received: from mail-oa0-f53.google.com ([209.85.219.53]:51925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TP2Y2-0002en-O9 for qemu-devel@nongnu.org; Thu, 18 Oct 2012 22:42:54 -0400 Received: by mail-oa0-f53.google.com with SMTP id j6so9571588oag.40 for ; Thu, 18 Oct 2012 19:42:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=PPsJpuC8wdVU28pauVCkILLc2v7bjQ2XgHqv5ycC8Uo=; b=pMrsXWxgNEc0AoOJKFFXAuZgYY05WQjyjac+nF1Y8m1Z393JtMlkbVwKoD5rgiGPd2 11UdjN6MeClD807PhuEGpKNV6jy9vqLJDDaLlr09u9buWJ61bKwCAkcONtqXbB8VanIj xxZdDrAJZNSMtbuJ8we5bWeFwzB4/9H7Ak3sflvK/Pd8h4RiMMaI5KmpzW7sagljs37M lIL0yQp+qmX4YoGEXLQJlmk1QhpDLULA6HzKMGMqc8wCfPEe2JVxEya9MiPtTCyOXS81 b+zkezxR1jho8ieN76bcHfBosqEGR7BPOMsgllaWKmiXwT3U60an4Csy96LezyiXqIF+ hnPQ== Received: by 10.60.32.19 with SMTP id e19mr21460884oei.9.1350614574168; Thu, 18 Oct 2012 19:42:54 -0700 (PDT) Received: from loki.austin.ibm.com ([32.97.110.59]) by mx.google.com with ESMTPS id m6sm475144obk.3.2012.10.18.19.42.52 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 18 Oct 2012 19:42:53 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Thu, 18 Oct 2012 21:42:09 -0500 Message-Id: <1350614540-28583-16-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1350614540-28583-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1350614540-28583-1-git-send-email-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.219.53 Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@us.ibm.com, blauwirbel@gmail.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH 15/26] qapi: add open-coded visitor for struct tm types 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 Reviewed-by: Anthony Liguori Reviewed-by: Paolo Bonzini Signed-off-by: Michael Roth --- qapi/Makefile.objs | 1 + qapi/misc-qapi-visit.c | 14 ++++++++++++++ qapi/qapi-visit-core.h | 3 +++ 3 files changed, 18 insertions(+) create mode 100644 qapi/misc-qapi-visit.c diff --git a/qapi/Makefile.objs b/qapi/Makefile.objs index 5f5846e..7604b52 100644 --- a/qapi/Makefile.objs +++ b/qapi/Makefile.objs @@ -1,3 +1,4 @@ qapi-obj-y = qapi-visit-core.o qapi-dealloc-visitor.o qmp-input-visitor.o qapi-obj-y += qmp-output-visitor.o qmp-registry.o qmp-dispatch.o qapi-obj-y += string-input-visitor.o string-output-visitor.o opts-visitor.o +qapi-obj-y += misc-qapi-visit.o diff --git a/qapi/misc-qapi-visit.c b/qapi/misc-qapi-visit.c new file mode 100644 index 0000000..5546865 --- /dev/null +++ b/qapi/misc-qapi-visit.c @@ -0,0 +1,14 @@ +#include +#include "qapi/qapi-visit-core.h" + +void visit_type_tm(Visitor *v, struct tm *obj, const char *name, Error **errp) +{ + visit_start_struct(v, NULL, "struct tm", name, 0, errp); + visit_type_int32(v, &obj->tm_year, "tm_year", errp); + visit_type_int32(v, &obj->tm_mon, "tm_mon", errp); + visit_type_int32(v, &obj->tm_mday, "tm_mday", errp); + visit_type_int32(v, &obj->tm_hour, "tm_hour", errp); + visit_type_int32(v, &obj->tm_min, "tm_min", errp); + visit_type_int32(v, &obj->tm_sec, "tm_sec", errp); + visit_end_struct(v, errp); +} diff --git a/qapi/qapi-visit-core.h b/qapi/qapi-visit-core.h index 5eb1616..10ec044 100644 --- a/qapi/qapi-visit-core.h +++ b/qapi/qapi-visit-core.h @@ -100,4 +100,7 @@ void visit_start_carray(Visitor *v, void **obj, const char *name, void visit_next_carray(Visitor *v, Error **errp); void visit_end_carray(Visitor *v, Error **errp); +/* misc. visitors */ +void visit_type_tm(Visitor *m, struct tm *obj, const char *name, Error **errp); + #endif