From patchwork Fri Sep 25 14:03:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 522822 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 543481402A2 for ; Sat, 26 Sep 2015 00:11:57 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ebYhBi7h; dkim-atps=neutral Received: from localhost ([::1]:42023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfTj9-0002mo-Ez for incoming@patchwork.ozlabs.org; Fri, 25 Sep 2015 10:11:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfTbr-0006VJ-Sn for qemu-devel@nongnu.org; Fri, 25 Sep 2015 10:04:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfTbq-0003R8-Hb for qemu-devel@nongnu.org; Fri, 25 Sep 2015 10:04:23 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:36166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfTbq-0003Ql-8Z for qemu-devel@nongnu.org; Fri, 25 Sep 2015 10:04:22 -0400 Received: by wicgb1 with SMTP id gb1so22046745wic.1 for ; Fri, 25 Sep 2015 07:04:21 -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:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=uhhEnxWyJlaMDKDJb2Yb/7eMFeDBmLDRtEY8GyvChJQ=; b=ebYhBi7hgrcj6KiR788YTY0GfLKM2OcoSrtdE9xkDsF3+htCy0IlPaX5jvVW1ZZTnd 1RkK8rhtNYuZU9bTIf08UQzY5uSIGcl1qc9fTXj/eqqSTPVTpf3s3xZy9PIv9SQSCBlz jK05Jzl4rySTJE/1tTlGJ3cgR+aTqNi+Js1JSHaYtT/k9tYZpXopv1tMLAO3lyMdV7vM W5mngX/GRk9GRa3Gy9AvCKZiL5pT0C2zdCc2M5njzYvcyqJ+6aapgsnIs39aHkmrzD6G to1a99gt0h0a8lSFfXAmKSTMiFOqfHwFdfa2tlVtk3fQwA1bzpS8azXLJuTbC0SEw12Y pxEQ== X-Received: by 10.194.114.104 with SMTP id jf8mr7160042wjb.155.1443189861681; Fri, 25 Sep 2015 07:04:21 -0700 (PDT) Received: from localhost ([149.6.167.210]) by smtp.gmail.com with ESMTPSA id fr10sm3415367wib.14.2015.09.25.07.04.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Sep 2015 07:04:20 -0700 (PDT) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Date: Fri, 25 Sep 2015 16:03:39 +0200 Message-Id: <1443189844-20341-12-git-send-email-marcandre.lureau@redhat.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1443189844-20341-1-git-send-email-marcandre.lureau@redhat.com> References: <1443189844-20341-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::234 Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , armbru@redhat.com, mdroth@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH 11/36] build-sys: generate QAPI doc based on json 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 From: Marc-André Lureau Learn to generate info/html/pdf/man documentation for QEMU and agent QMP APIs. This allows to provide missing agent documentation, and should help getting rid of the duplicate documentation in qmp-commands.hx. Signed-off-by: Marc-André Lureau --- Makefile | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 68e2e1b..918ad4e 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF) ifdef BUILD_DOCS DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8 -DOCS+=qmp-commands.txt +DOCS+=qmp-commands.txt qemu-qapi.7 qemu-ga-qapi.7 ifdef CONFIG_LINUX DOCS+=kvm_stat.1 endif @@ -249,6 +249,7 @@ qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated gen-out-type = $(subst .,-,$(suffix $@)) qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py +qapi-py += $(SRC_PATH)/scripts/qapi2texi.py qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\ $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py) @@ -363,7 +364,7 @@ distclean: clean rm -f qemu-doc.vr rm -f config.log rm -f linux-headers/asm - rm -f qemu-tech.info qemu-tech.aux qemu-tech.cp qemu-tech.dvi qemu-tech.fn qemu-tech.info qemu-tech.ky qemu-tech.log qemu-tech.pdf qemu-tech.pg qemu-tech.toc qemu-tech.tp qemu-tech.vr + rm -f qemu-tech.info qemu-tech.aux qemu-tech.cp qemu-tech.dvi qemu-tech.fn qemu-tech.info qemu-tech..ky qemu-tech.log qemu-tech.pdf qemu-tech.pg qemu-tech.toc qemu-tech.tp qemu-tech.vr qemu-qapi.info qemu-qapi.aux qemu-qapi.cp qemu-qapi.dvi qemu-qapi.fn qemu-qapi.info qemu-qapi..ky qemu-qapi.log qemu-qapi.pdf qemu-qapi.pg qemu-qapi.toc qemu-qapi.tp qemu-qapi.vr qemu-ga-qapi.info qemu-ga-qapi.aux qemu-ga-qapi.cp qemu-ga-qapi.dvi qemu-ga-qapi.fn qemu-ga-qapi.info qemu-ga-qapi..ky qemu-ga-qapi.log qemu-ga-qapi.pdf qemu-ga-qapi.pg qemu-ga-qapi.toc qemu-ga-qapi.tp qemu-ga-qapi.vr for d in $(TARGET_DIRS); do \ rm -rf $$d || exit 1 ; \ done @@ -408,6 +409,7 @@ ifneq ($(TOOLS),) $(INSTALL_DATA) qemu-img.1 "$(DESTDIR)$(mandir)/man1" $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8" $(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8" + $(INSTALL_DATA) qemu-qapi.7 qemu-ga-qapi.7 "$(DESTDIR)$(mandir)/man7" endif ifneq (,$(findstring qemu-ga,$(TOOLS))) $(INSTALL_DATA) qemu-ga.8 "$(DESTDIR)$(mandir)/man8" @@ -529,6 +531,16 @@ qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@") +qemu-qapi.texi: $(qapi-modules) $(qapi-py) + $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py \ + "QEMU QAPI Reference Manual" $(VERSION) qemu-qapi \ + $< > $@," GEN $@") + +qemu-ga-qapi.texi: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py) + $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py \ + "QEMU Guest Agent QAPI Reference Manual" $(VERSION) qemu-ga-qapi \ + $< > $@," GEN $@") + qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi $(call quiet-command, \ perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \ @@ -559,16 +571,28 @@ qemu-ga.8: qemu-ga.texi $(POD2MAN) --section=8 --center=" " --release=" " qemu-ga.pod > $@, \ " GEN $@") +qemu-qapi.7: qemu-qapi.texi + $(call quiet-command, \ + perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-qapi.pod && \ + $(POD2MAN) --section=7 --center=" " --release=" " qemu-qapi.pod > $@, \ + " GEN $@") + +qemu-ga-qapi.7: qemu-ga-qapi.texi + $(call quiet-command, \ + perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-ga-qapi.pod && \ + $(POD2MAN) --section=7 --center=" " --release=" " qemu-ga-qapi.pod > $@, \ + " GEN $@") + kvm_stat.1: scripts/kvm/kvm_stat.texi $(call quiet-command, \ perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< kvm_stat.pod && \ $(POD2MAN) --section=1 --center=" " --release=" " kvm_stat.pod > $@, \ " GEN $@") -dvi: qemu-doc.dvi qemu-tech.dvi -html: qemu-doc.html qemu-tech.html -info: qemu-doc.info qemu-tech.info -pdf: qemu-doc.pdf qemu-tech.pdf +dvi: qemu-doc.dvi qemu-tech.dvi qemu-qapi.dvi +html: qemu-doc.html qemu-tech.html qemu-qapi.html +info: qemu-doc.info qemu-tech.info qemu-qapi.info +pdf: qemu-doc.pdf qemu-tech.pdf qemu-qapi.pdf qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \ qemu-img.texi qemu-nbd.texi qemu-options.texi \