get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 27996,
    "url": "https://patches.dpdk.org/api/patches/27996/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1503676941-80981-5-git-send-email-david.hunt@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "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",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1503676941-80981-5-git-send-email-david.hunt@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1503676941-80981-5-git-send-email-david.hunt@intel.com",
    "date": "2017-08-25T16:02:15",
    "name": "[dpdk-dev,v1,04/10] examples/vm_power_mgr: add vcpu to pcpu mapping",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "05f7e82c982b9b5291b07107d9cac0e9e605e246",
    "submitter": {
        "id": 342,
        "url": "https://patches.dpdk.org/api/people/342/?format=api",
        "name": "Hunt, David",
        "email": "david.hunt@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1503676941-80981-5-git-send-email-david.hunt@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/27996/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/27996/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 1B3BC7D87;\n\tFri, 25 Aug 2017 18:02:40 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id D0D727D0B\n\tfor <dev@dpdk.org>; Fri, 25 Aug 2017 18:02:32 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Aug 2017 09:02:32 -0700",
            "from silpixa00397898.ir.intel.com (HELO\n\tsilpixa00397898.ger.corp.intel.com) ([10.237.223.116])\n\tby fmsmga001.fm.intel.com with ESMTP; 25 Aug 2017 09:02:30 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.41,426,1498546800\"; d=\"scan'208\";\n\ta=\"1188144530\"",
        "From": "David Hunt <david.hunt@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "David Hunt <david.hunt@intel.com>,\n\tNemanja Marjanovic <nemanja.marjanovic@intel.com>,\n\tRory Sexton <rory.sexton@intel.com>",
        "Date": "Fri, 25 Aug 2017 17:02:15 +0100",
        "Message-Id": "<1503676941-80981-5-git-send-email-david.hunt@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1503676941-80981-1-git-send-email-david.hunt@intel.com>",
        "References": "<1503676941-80981-1-git-send-email-david.hunt@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v1 04/10] examples/vm_power_mgr: add vcpu to pcpu\n\tmapping",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Signed-off-by: Nemanja Marjanovic <nemanja.marjanovic@intel.com>\nSigned-off-by: Rory Sexton <rory.sexton@intel.com>\nSigned-off-by: David Hunt <david.hunt@intel.com>\n---\n examples/vm_power_manager/channel_manager.c | 55 +++++++++++++++++++++++++++++\n examples/vm_power_manager/channel_manager.h | 16 ++++++++-\n 2 files changed, 70 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c\nindex e068ae2..2abba9c 100644\n--- a/examples/vm_power_manager/channel_manager.c\n+++ b/examples/vm_power_manager/channel_manager.c\n@@ -574,6 +574,61 @@ set_channel_status(const char *vm_name, unsigned *channel_list,\n \treturn num_channels_changed;\n }\n \n+void\n+get_all_vm(int *noVms, int *noVcpus) {\n+\n+\tvirNodeInfo info;\n+\tvirDomainPtr *domptr;\n+\tuint64_t mask;\n+\tint ret, i, numVcpus[MAX_VCPUS], cpu;\n+\tunsigned int ii, jj, n_vcpus;\n+\tconst char *vm_name;\n+\tunsigned int flags = VIR_CONNECT_LIST_DOMAINS_RUNNING |\n+\t\t\t\tVIR_CONNECT_LIST_DOMAINS_PERSISTENT;\n+\tunsigned int flag = VIR_DOMAIN_VCPU_CONFIG;\n+\n+\n+\tmemset(global_cpumaps, 0, CHANNEL_CMDS_MAX_CPUS*global_maplen);\n+\tif (virNodeGetInfo(global_vir_conn_ptr, &info))\n+\t\tRTE_LOG(ERR, CHANNEL_MANAGER, \"Unable to retrieve node Info\\n\");\n+\n+\t/*Returns number of pcpus*/\n+\tglobal_n_host_cpus = (unsigned int)info.cpus;\n+\n+\t/*Returns number of active domains */\n+\tret = virConnectListAllDomains(global_vir_conn_ptr, &domptr, flags);\n+\t*noVms = ret;\n+\tif (ret < 0)\n+\t\tRTE_LOG(ERR, CHANNEL_MANAGER, \"No Active Domains Running\\n\");\n+\n+\tfor (i = 0; i < ret; i++) {\n+\n+\t\t/*Get Domain Names*/\n+\t\tvm_name = virDomainGetName(domptr[i]);\n+\t\tlvm_info[i].vm_name = vm_name;\n+\t\t/*Get Number of Vcpus*/\n+\t\tnumVcpus[i] = virDomainGetVcpusFlags(domptr[i], flag);\n+\t\t/*Get Number of VCpus & VcpuPinInfo*/\n+\t\tn_vcpus = virDomainGetVcpuPinInfo(domptr[i],\n+\t\t\t\tnumVcpus[i], global_cpumaps,\n+\t\t\t\tglobal_maplen, flag);\n+\t\tif ((int)n_vcpus > *noVcpus)\n+\t\t\t*noVcpus = n_vcpus;\n+\t\tfor (ii = 0; ii < n_vcpus; ii++) {\n+\t\t\tmask = 0;\n+\t\t\tfor (jj = 0; jj < global_n_host_cpus; jj++) {\n+\t\t\t\tif (VIR_CPU_USABLE(global_cpumaps,\n+\t\t\t\t\t\tglobal_maplen, ii, jj) > 0) {\n+\t\t\t\t\tmask |= 1ULL << jj;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tITERATIVE_BITMASK_CHECK_64(mask, cpu) {\n+\t\t\t\tlvm_info[i].pcpus[ii] = cpu;\n+\t\t\t}\n+\t\t}\n+\t}\n+}\n+\n int\n get_info_vm(const char *vm_name, struct vm_info *info)\n {\ndiff --git a/examples/vm_power_manager/channel_manager.h b/examples/vm_power_manager/channel_manager.h\nindex 47c3b9c..8dff76c 100644\n--- a/examples/vm_power_manager/channel_manager.h\n+++ b/examples/vm_power_manager/channel_manager.h\n@@ -66,6 +66,16 @@ struct sockaddr_un _sockaddr_un;\n #define UNIX_PATH_MAX sizeof(_sockaddr_un.sun_path)\n #endif\n \n+#define MAX_VMS 4\n+#define MAX_VCPUS 20\n+\n+\n+struct libvirt_vm_info {\n+\tconst char *vm_name;\n+\tunsigned int pcpus[22];\n+};\n+\n+struct libvirt_vm_info lvm_info[MAX_VMS];\n /* Communication Channel Status */\n enum channel_status { CHANNEL_MGR_CHANNEL_DISCONNECTED = 0,\n \tCHANNEL_MGR_CHANNEL_CONNECTED,\n@@ -318,7 +328,11 @@ int set_channel_status(const char *vm_name, unsigned *channel_list,\n  *  - Negative on error.\n  */\n int get_info_vm(const char *vm_name, struct vm_info *info);\n-\n+/**\n+ * Populates a table with all domains running and their physical cpu.\n+ * All information is gathered through libvirt api.\n+ */\n+void get_all_vm(int *noVms, int *noVcpus);\n #ifdef __cplusplus\n }\n #endif\n",
    "prefixes": [
        "dpdk-dev",
        "v1",
        "04/10"
    ]
}