xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Xen Devel <xen-devel@lists.xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH v2 1/2] libxl: Add "cpu-add" QMP command.
Date: Mon, 17 Jun 2013 15:20:32 +0100	[thread overview]
Message-ID: <1371478833-29419-1-git-send-email-anthony.perard@citrix.com> (raw)
In-Reply-To: <1371478402-28082-1-git-send-email-anthony.perard@citrix.com>

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libxl/libxl_internal.h |  2 ++
 tools/libxl/libxl_qmp.c      | 21 +++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 3ba3a21..3e45b94 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1412,6 +1412,8 @@ _hidden int libxl__qmp_save(libxl__gc *gc, int domid, const char *filename);
 /* Set dirty bitmap logging status */
 _hidden int libxl__qmp_set_global_dirty_log(libxl__gc *gc, int domid, bool enable);
 _hidden int libxl__qmp_insert_cdrom(libxl__gc *gc, int domid, const libxl_device_disk *disk);
+/* Add a virtual CPU */
+_hidden int libxl__qmp_cpu_add(libxl__gc *gc, int domid, int index);
 /* close and free the QMP handler */
 _hidden void libxl__qmp_close(libxl__qmp_handler *qmp);
 /* remove the socket file, if the file has already been removed,
diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c
index 644d2c0..3d6dec6 100644
--- a/tools/libxl/libxl_qmp.c
+++ b/tools/libxl/libxl_qmp.c
@@ -668,6 +668,18 @@ static void qmp_parameters_add_bool(libxl__gc *gc,
     qmp_parameters_common_add(gc, param, name, obj);
 }
 
+static void qmp_parameters_add_integer(libxl__gc *gc,
+                                       libxl__json_object **param,
+                                       const char *name, const int i)
+{
+    libxl__json_object *obj;
+
+    obj = libxl__json_object_alloc(gc, JSON_INTEGER);
+    obj->u.i = i;
+
+    qmp_parameters_common_add(gc, param, name, obj);
+}
+
 #define QMP_PARAMETERS_SPRINTF(args, name, format, ...) \
     qmp_parameters_add_string(gc, args, name, \
                               libxl__sprintf(gc, format, __VA_ARGS__))
@@ -929,6 +941,15 @@ int libxl__qmp_insert_cdrom(libxl__gc *gc, int domid,
     }
 }
 
+int libxl__qmp_cpu_add(libxl__gc *gc, int domid, int index)
+{
+    libxl__json_object *args = NULL;
+
+    qmp_parameters_add_integer(gc, &args, "id", index);
+
+    return qmp_run_command(gc, domid, "cpu-add", args, NULL, NULL);
+}
+
 int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid,
                                const libxl_domain_config *guest_config)
 {
-- 
Anthony PERARD

  parent reply	other threads:[~2013-06-17 14:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-17 14:13 [PATCH v2 0/7] CPU hotplug for qemu-xen for 4.3 Anthony PERARD
2013-06-17 14:15 ` [PATCH 1/7] cpu: Introduce get_arch_id() method and override it for X86CPU Anthony PERARD
2013-06-17 14:15   ` [PATCH 2/7] cpu: Add qemu_for_each_cpu() Anthony PERARD
2013-06-17 14:15   ` [PATCH 3/7] acpi_piix4: Add infrastructure to send CPU hot-plug GPE to guest Anthony PERARD
2013-06-17 14:15   ` [PATCH 4/7] Add hot_add_cpu hook to QEMUMachine Anthony PERARD
2013-06-17 14:15   ` [PATCH 5/7] QMP: Add cpu-add command Anthony PERARD
2013-06-17 14:15   ` [PATCH 6/7] xen: Fix vcpus initialisation Anthony PERARD
2013-06-20 11:14     ` Stefano Stabellini
2013-06-17 14:15   ` [PATCH 7/7] xen: Implement hot_add_cpu hook Anthony PERARD
2013-06-20 11:21     ` Stefano Stabellini
2013-06-20 13:19       ` Anthony PERARD
2013-06-20 13:40     ` Stefano Stabellini
2013-06-21 17:40       ` Anthony PERARD
2013-06-17 14:20 ` Anthony PERARD [this message]
2013-06-17 14:20   ` [PATCH v2 2/2] libxl: Use QMP cpu-add to hotplug CPU with qemu-xen Anthony PERARD
2013-06-17 15:31     ` Ian Campbell
2013-06-17 15:50       ` Anthony PERARD
2013-06-20 11:12         ` Stefano Stabellini
2013-06-17 15:25   ` [PATCH v2 1/2] libxl: Add "cpu-add" QMP command Ian Campbell
2013-06-17 15:28     ` Anthony PERARD
2013-06-17 15:31       ` Ian Campbell
2013-06-17 14:22 ` [PATCH v2] xen: Allow CPU to be counted than currently "plugged" Anthony PERARD
2013-06-17 15:24   ` Ian Campbell
2013-06-17 15:44     ` Anthony PERARD
2013-06-24 16:57 ` [PATCH v2 0/7] CPU hotplug for qemu-xen for 4.3 Stefano Stabellini
2013-06-24 17:21   ` Stefano Stabellini
2013-06-24 17:28     ` Anthony PERARD
2013-06-25  9:19   ` George Dunlap
2013-06-25 11:40     ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371478833-29419-1-git-send-email-anthony.perard@citrix.com \
    --to=anthony.perard@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).