Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/819551/?format=api
{ "id": 819551, "url": "http://patchwork.ozlabs.org/api/patches/819551/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170928120621.30288-2-berrange@redhat.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170928120621.30288-2-berrange@redhat.com>", "list_archive_url": null, "date": "2017-09-28T12:06:16", "name": "[v7,1/6] build: automatically handle GIT submodule checkout for dtc", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "6002c3739fc179816f387e1c8fe4106e5dfcd401", "submitter": { "id": 2694, "url": "http://patchwork.ozlabs.org/api/people/2694/?format=api", "name": "Daniel P. Berrangé", "email": "berrange@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170928120621.30288-2-berrange@redhat.com/mbox/", "series": [ { "id": 5547, "url": "http://patchwork.ozlabs.org/api/series/5547/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=5547", "date": "2017-09-28T12:06:16", "name": "Initial support for keycodemapdb GIT submodule", "version": 7, "mbox": "http://patchwork.ozlabs.org/series/5547/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/819551/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/819551/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)", "ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com" ], "Received": [ "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y2tjJ3LZrz9t3v\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Sep 2017 22:07:16 +1000 (AEST)", "from localhost ([::1]:58957 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dxXb0-0000DG-AQ\n\tfor incoming@patchwork.ozlabs.org; Thu, 28 Sep 2017 08:07:14 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:44426)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dxXaP-0000CZ-5S\n\tfor qemu-devel@nongnu.org; Thu, 28 Sep 2017 08:06:38 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dxXaM-0007jv-9P\n\tfor qemu-devel@nongnu.org; Thu, 28 Sep 2017 08:06:37 -0400", "from mx1.redhat.com ([209.132.183.28]:37288)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dxXaM-0007jU-0s\n\tfor qemu-devel@nongnu.org; Thu, 28 Sep 2017 08:06:34 -0400", "from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 11B9E2A7830;\n\tThu, 28 Sep 2017 12:06:33 +0000 (UTC)", "from t460.redhat.com (unknown [10.33.36.70])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 4EF6090C67;\n\tThu, 28 Sep 2017 12:06:31 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 11B9E2A7830", "From": "\"Daniel P. Berrange\" <berrange@redhat.com>", "To": "qemu-devel@nongnu.org", "Date": "Thu, 28 Sep 2017 13:06:16 +0100", "Message-Id": "<20170928120621.30288-2-berrange@redhat.com>", "In-Reply-To": "<20170928120621.30288-1-berrange@redhat.com>", "References": "<20170928120621.30288-1-berrange@redhat.com>", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.14", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tThu, 28 Sep 2017 12:06:33 +0000 (UTC)", "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]", "X-Received-From": "209.132.183.28", "Subject": "[Qemu-devel] [PATCH v7 1/6] build: automatically handle GIT\n\tsubmodule checkout for dtc", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.21", "Precedence": "list", "List-Id": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Cc": "Peter Maydell <peter.maydell@linaro.org>, Fam Zheng <famz@redhat.com>,\n\tGerd Hoffmann <kraxel@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>" }, "content": "Currently if DTC is required by configure and not available in the host\nOS install, we exit with an error message telling the user to checkout a\ngit submodule or install the library.\n\nThis introduces automatic handling of the git submodule checkout process\nand enables it for dtc. This only runs if building from GIT, so users of\nrelease tarballs still need the system library install. The current state\nof the git checkout is stashed in .git-submodule-status, and a helper\nprogram is used to determine if this state matches the desired submodule\nstate. A dependency against 'Makefile' ensures that the submodule state\nis refreshed at the start of the build process\n\nSigned-off-by: Daniel P. Berrange <berrange@redhat.com>\n---\n .gitignore | 1 +\n Makefile | 23 ++++++++++++++++++++++-\n configure | 46 ++++++++++++++++++++++++++--------------------\n scripts/git-submodule.sh | 31 +++++++++++++++++++++++++++++++\n 4 files changed, 80 insertions(+), 21 deletions(-)\n create mode 100755 scripts/git-submodule.sh", "diff": "diff --git a/.gitignore b/.gitignore\nindex 40acfcb9e2..06bf972fc3 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -112,6 +112,7 @@\n /docs/version.texi\n *.tps\n .stgit-*\n+.git-submodule-status\n cscope.*\n tags\n TAGS\ndiff --git a/Makefile b/Makefile\nindex 2be61fcf1c..e9d9e1840f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -14,6 +14,27 @@ ifneq ($(wildcard config-host.mak),)\n all:\n include config-host.mak\n \n+git-submodule-update:\n+\n+.PHONY: git-submodule-update\n+\n+ifeq (0,$(MAKELEVEL))\n+ git_module_status := $(shell \\\n+ cd '$(SRC_PATH)'; \\\n+ ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \\\n+ echo $$?; \\\n+ )\n+\n+ifeq (1,$(git_module_status))\n+git-submodule-update:\n+\t$(call quiet-command, \\\n+ (cd $(SRC_PATH); ./scripts/git-submodule.sh update $(GIT_SUBMODULES)), \\\n+ \"GIT\",\"$(GIT_SUBMODULES)\")\n+endif\n+endif\n+\n+.git-submodule-status: git-submodule-update\n+\n # Check that we're not trying to do an out-of-tree build from\n # a tree that's been used for an in-tree build.\n ifneq ($(realpath $(SRC_PATH)),$(realpath .))\n@@ -329,7 +350,7 @@ DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V=\"$(V)\" LIBFDT_src\n DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)\n DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt\n \n-subdir-dtc:dtc/libfdt dtc/tests\n+subdir-dtc: .git-submodule-status dtc/libfdt dtc/tests\n \t$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS=\"$(DTC_CPPFLAGS)\" CFLAGS=\"$(DTC_CFLAGS)\" LDFLAGS=\"$(LDFLAGS)\" ARFLAGS=\"$(ARFLAGS)\" CC=\"$(CC)\" AR=\"$(AR)\" LD=\"$(LD)\" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)\n \n dtc/%:\ndiff --git a/configure b/configure\nindex 7727f6ba5b..ed4048f8b2 100755\n--- a/configure\n+++ b/configure\n@@ -264,6 +264,7 @@ cc_i386=i386-pc-linux-gnu-gcc\n libs_qga=\"\"\n debug_info=\"yes\"\n stack_protector=\"\"\n+git_submodules=\"\"\n \n # Don't accept a target_list environment variable.\n unset target_list\n@@ -3580,27 +3581,30 @@ EOF\n if compile_prog \"\" \"$fdt_libs\" ; then\n # system DTC is good - use it\n fdt=yes\n- elif test -d ${source_path}/dtc/libfdt ; then\n- # have submodule DTC - use it\n- fdt=yes\n- dtc_internal=\"yes\"\n- mkdir -p dtc\n- if [ \"$pwd_is_source_path\" != \"y\" ] ; then\n- symlink \"$source_path/dtc/Makefile\" \"dtc/Makefile\"\n- symlink \"$source_path/dtc/scripts\" \"dtc/scripts\"\n- fi\n- fdt_cflags=\"-I\\$(SRC_PATH)/dtc/libfdt\"\n- fdt_libs=\"-L\\$(BUILD_DIR)/dtc/libfdt $fdt_libs\"\n- elif test \"$fdt\" = \"yes\" ; then\n- # have neither and want - prompt for system/submodule install\n- error_exit \"DTC (libfdt) version >= 1.4.2 not present. Your options:\" \\\n- \" (1) Preferred: Install the DTC (libfdt) devel package\" \\\n- \" (2) Fetch the DTC submodule, using:\" \\\n- \" git submodule update --init dtc\"\n else\n- # don't have and don't want\n- fdt_libs=\n- fdt=no\n+ # have GIT checkout, so activate dtc submodule\n+ if test -d ${source_path}/.git ; then\n+\t git_submodules=\"${git_submodules} dtc\"\n+ fi\n+ if test -d ${source_path}/dtc/libfdt || test -d ${source_path}/.git ; then\n+\t fdt=yes\n+\t dtc_internal=\"yes\"\n+\t mkdir -p dtc\n+\t if [ \"$pwd_is_source_path\" != \"y\" ] ; then\n+\t symlink \"$source_path/dtc/Makefile\" \"dtc/Makefile\"\n+\t symlink \"$source_path/dtc/scripts\" \"dtc/scripts\"\n+\t fi\n+\t fdt_cflags=\"-I\\$(SRC_PATH)/dtc/libfdt\"\n+\t fdt_libs=\"-L\\$(BUILD_DIR)/dtc/libfdt $fdt_libs\"\n+ elif test \"$fdt\" = \"yes\" ; then\n+\t # have neither and want - prompt for system/submodule install\n+\t error_exit \"DTC (libfdt) version >= 1.4.2 not present.\" \\\n+\t\t \"Please install the DTC (libfdt) devel package\"\n+ else\n+\t # don't have and don't want\n+\t fdt_libs=\n+\t fdt=no\n+ fi\n fi\n fi\n \n@@ -5290,6 +5294,7 @@ echo \"local state directory queried at runtime\"\n echo \"Windows SDK $win_sdk\"\n fi\n echo \"Source path $source_path\"\n+echo \"GIT submodules $git_submodules\"\n echo \"C compiler $cc\"\n echo \"Host C compiler $host_cc\"\n echo \"C++ compiler $cxx\"\n@@ -5477,6 +5482,7 @@ echo \"extra_cxxflags=$EXTRA_CXXFLAGS\" >> $config_host_mak\n echo \"extra_ldflags=$EXTRA_LDFLAGS\" >> $config_host_mak\n echo \"qemu_localedir=$qemu_localedir\" >> $config_host_mak\n echo \"libs_softmmu=$libs_softmmu\" >> $config_host_mak\n+echo \"GIT_SUBMODULES=$git_submodules\" >> $config_host_mak\n \n echo \"ARCH=$ARCH\" >> $config_host_mak\n \ndiff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh\nnew file mode 100755\nindex 0000000000..f8e7d44ce6\n--- /dev/null\n+++ b/scripts/git-submodule.sh\n@@ -0,0 +1,31 @@\n+#!/bin/bash\n+\n+set -e\n+\n+command=$1\n+shift\n+modules=\"$@\"\n+\n+test -z \"$modules\" && exit 0\n+\n+if ! test -d \".git\"\n+then\n+ echo \"$0: unexpectedly called with submodules but no git checkout exists\"\n+ exit 1\n+fi\n+\n+substat=\".git-submodule-status\"\n+\n+case \"$command\" in\n+status)\n+ test -f \"$substat\" || exit 1\n+ git submodule status $modules > \"${substat}.tmp\"\n+ trap \"rm -f ${substat}.tmp\" EXIT\n+ diff \"${substat}\" \"${substat}.tmp\" >/dev/null\n+ exit $?\n+ ;;\n+update)\n+ git submodule update --init $modules 1>/dev/null 2>&1\n+ git submodule status $modules > \"${substat}\"\n+ ;;\n+esac\n", "prefixes": [ "v7", "1/6" ] }