Show a patch.

GET /api/patches/480/
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 480,
    "url": "http://patches.dpdk.org/api/patches/480/",
    "web_url": "http://patches.dpdk.org/patch/480/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk"
    },
    "msgid": "<1411579576-21786-5-git-send-email-alan.carew@intel.com>",
    "date": "2014-09-24T17:26:10",
    "name": "[dpdk-dev,v2,04/10] VM Power Management application and Makefile.",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "3fc82d7f65bac757024ff423bc79292a220e014e",
    "submitter": {
        "id": 72,
        "url": "http://patches.dpdk.org/api/people/72/",
        "name": "Alan Carew",
        "email": "alan.carew@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/patch/480/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/480/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/480/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "References": "<1411410879-28872-1-git-send-email-alan.carew@intel.com>\n\t<1411579576-21786-1-git-send-email-alan.carew@intel.com>",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,590,1406617200\"; d=\"scan'208\";a=\"596286384\"",
        "Date": "Wed, 24 Sep 2014 18:26:10 +0100",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1411579576-21786-5-git-send-email-alan.carew@intel.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 2B82DB3B6;\n\tWed, 24 Sep 2014 19:20:34 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id E136EB379\n\tfor <dev@dpdk.org>; Wed, 24 Sep 2014 19:20:29 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga102.fm.intel.com with ESMTP; 24 Sep 2014 10:26:42 -0700",
            "from sie-lab-212-143.ir.intel.com (HELO\n\tsilpixa00385294.ir.intel.com) ([10.237.212.143])\n\tby fmsmga001.fm.intel.com with ESMTP; 24 Sep 2014 10:26:41 -0700"
        ],
        "List-Post": "<mailto:dev@dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH v2 04/10] VM Power Management application and\n\tMakefile.",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "X-Mailer": "git-send-email 1.9.3",
        "Precedence": "list",
        "From": "Alan Carew <alan.carew@intel.com>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-ExtLoop1": "1",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "Delivered-To": "patchwork@dpdk.org",
        "In-Reply-To": "<1411579576-21786-1-git-send-email-alan.carew@intel.com>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "To": "dev@dpdk.org",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "For launching CLI thread and Monitor thread and initialising\nresources.\nRequires a minimum of two lcores to run, additional cores specified by eal core\nmask are not used.\n\nSigned-off-by: Alan Carew <alan.carew@intel.com>\n---\n examples/vm_power_manager/Makefile |  57 +++++++++++++++++++\n examples/vm_power_manager/main.c   | 113 +++++++++++++++++++++++++++++++++++++\n examples/vm_power_manager/main.h   |  52 +++++++++++++++++\n 3 files changed, 222 insertions(+)\n create mode 100644 examples/vm_power_manager/Makefile\n create mode 100644 examples/vm_power_manager/main.c\n create mode 100644 examples/vm_power_manager/main.h",
    "diff": "diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile\nnew file mode 100644\nindex 0000000..7d6f943\n--- /dev/null\n+++ b/examples/vm_power_manager/Makefile\n@@ -0,0 +1,57 @@\n+#   BSD LICENSE\n+#\n+#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+#   All rights reserved.\n+#\n+#   Redistribution and use in source and binary forms, with or without\n+#   modification, are permitted provided that the following conditions\n+#   are met:\n+#\n+#     * Redistributions of source code must retain the above copyright\n+#       notice, this list of conditions and the following disclaimer.\n+#     * Redistributions in binary form must reproduce the above copyright\n+#       notice, this list of conditions and the following disclaimer in\n+#       the documentation and/or other materials provided with the\n+#       distribution.\n+#     * Neither the name of Intel Corporation nor the names of its\n+#       contributors may be used to endorse or promote products derived\n+#       from this software without specific prior written permission.\n+#\n+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+#   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+\n+ifeq ($(RTE_SDK),)\n+$(error \"Please define RTE_SDK environment variable\")\n+endif\n+\n+# Default target, can be overriden by command line or environment\n+RTE_TARGET ?= x86_64-default-linuxapp-gcc\n+\n+include $(RTE_SDK)/mk/rte.vars.mk\n+\n+# binary name\n+APP = vm_power_mgr\n+\n+# all source are stored in SRCS-y\n+SRCS-y := main.c vm_power_cli.c power_manager.c channel_manager.c\n+SRCS-y += channel_monitor.c\n+\n+CFLAGS += -O3 -lvirt -I$(RTE_SDK)/lib/librte_power/\n+CFLAGS += $(WERROR_FLAGS)\n+\n+# workaround for a gcc bug with noreturn attribute\n+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603\n+ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)\n+CFLAGS_main.o += -Wno-return-type\n+endif\n+\n+include $(RTE_SDK)/mk/rte.extapp.mk\ndiff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c\nnew file mode 100644\nindex 0000000..fdb9e73\n--- /dev/null\n+++ b/examples/vm_power_manager/main.c\n@@ -0,0 +1,113 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ *   All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of Intel Corporation nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <stdio.h>\n+#include <string.h>\n+#include <stdint.h>\n+#include <errno.h>\n+#include <sys/epoll.h>\n+#include <fcntl.h>\n+#include <unistd.h>\n+#include <stdlib.h>\n+#include <unistd.h>\n+#include <signal.h>\n+#include <errno.h>\n+\n+#include <sys/queue.h>\n+\n+#include <rte_common.h>\n+#include <rte_eal.h>\n+#include <rte_launch.h>\n+#include <rte_log.h>\n+#include <rte_per_lcore.h>\n+#include <rte_lcore.h>\n+#include <rte_debug.h>\n+#include <rte_config.h>\n+\n+#include \"channel_manager.h\"\n+#include \"channel_monitor.h\"\n+#include \"power_manager.h\"\n+#include \"vm_power_cli.h\"\n+#include \"main.h\"\n+\n+static int\n+run_monitor(__attribute__((unused)) void *arg)\n+{\n+\tif (channel_manager_init(DEFAULT_HV_PATH) < 0) {\n+\t\tprintf(\"Unable to initialize channel manager\\n\");\n+\t\treturn -1;\n+\t}\n+\tif (channel_monitor_init() < 0) {\n+\t\tprintf(\"Unable to initialize channel monitor\\n\");\n+\t\treturn -1;\n+\t}\n+\trun_channel_monitor();\n+\treturn 0;\n+}\n+\n+static void\n+sig_handler(int signo)\n+{\n+\tprintf(\"Received signal %d, exiting...\\n\", signo);\n+\tchannel_monitor_exit();\n+\tchannel_manager_exit();\n+\tpower_manager_exit();\n+\n+}\n+\n+int\n+MAIN(int argc, char **argv)\n+{\n+\tint ret;\n+\tunsigned lcore_id;\n+\n+\tret = rte_eal_init(argc, argv);\n+\tif (ret < 0)\n+\t\trte_panic(\"Cannot init EAL\\n\");\n+\n+\tsignal(SIGINT, sig_handler);\n+\tsignal(SIGTERM, sig_handler);\n+\n+\tlcore_id = rte_get_next_lcore(-1, 1, 0);\n+\tif (lcore_id == RTE_MAX_LCORE) {\n+\t\tRTE_LOG(ERR, EAL, \"A minimum of two cores are required to run \"\n+\t\t\t\t\"application\\n\");\n+\t\treturn 0;\n+\t}\n+\trte_eal_remote_launch(run_monitor, NULL, lcore_id);\n+\n+\trun_cli(NULL);\n+\n+\trte_eal_mp_wait_lcore();\n+\treturn 0;\n+}\ndiff --git a/examples/vm_power_manager/main.h b/examples/vm_power_manager/main.h\nnew file mode 100644\nindex 0000000..7b4c3da\n--- /dev/null\n+++ b/examples/vm_power_manager/main.h\n@@ -0,0 +1,52 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ *   All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of Intel Corporation nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _MAIN_H_\n+#define _MAIN_H_\n+\n+#ifdef RTE_EXEC_ENV_BAREMETAL\n+#define MAIN _main\n+#else\n+#define MAIN main\n+#endif\n+\n+int MAIN(int argc, char **argv);\n+\n+#endif /* _MAIN_H_ */\n+\n+#ifndef MAIN_H_\n+#define MAIN_H_\n+\n+\n+\n+#endif /* MAIN_H_ */\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "04/10"
    ]
}