qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Baptiste Reynal <b.reynal@virtualopensystems.com>
To: qemu-devel@nongnu.org
Cc: b.reynal@virtualopensystems.com, Jani.Kokkonen@huawei.com,
	tech@virtualopensystems.com, Claudio.Fontana@huawei.com,
	Christian Pinto <c.pinto@virtualopensystems.com>
Subject: [Qemu-devel] [RFC v2 4/6] qemu: slave machine flag
Date: Fri, 18 Mar 2016 10:13:56 +0100	[thread overview]
Message-ID: <1458292438-13909-5-git-send-email-b.reynal@virtualopensystems.com> (raw)
In-Reply-To: <1458292438-13909-1-git-send-email-b.reynal@virtualopensystems.com>

From: Christian Pinto <c.pinto@virtualopensystems.com>

This patch adds a new machine flag, to configure qemu as a slave instance.

Usage

-machine -slave=[on|off] (default=off)

Signed-off-by: Christian Pinto <c.pinto@virtualopensystems.com>
---
 hw/core/machine.c   | 27 +++++++++++++++++++++++++++
 include/hw/boards.h |  2 ++
 qemu-options.hx     |  5 ++++-
 util/qemu-config.c  |  5 +++++
 4 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index f4db340..b3e1e28 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -283,6 +283,20 @@ static bool machine_get_suppress_vmdesc(Object *obj, Error **errp)
     return ms->suppress_vmdesc;
 }
 
+static bool machine_get_slave(Object *obj, Error **errp)
+{
+    MachineState *ms = MACHINE(obj);
+
+    return ms->slave;
+}
+
+static void machine_set_slave(Object *obj, bool value, Error **errp)
+{
+    MachineState *ms = MACHINE(obj);
+
+    ms->slave = value;
+}
+
 static int error_on_sysbus_device(SysBusDevice *sbdev, void *opaque)
 {
     error_report("Option '-device %s' cannot be handled by this machine",
@@ -335,6 +349,7 @@ static void machine_initfn(Object *obj)
     ms->kvm_shadow_mem = -1;
     ms->dump_guest_core = true;
     ms->mem_merge = true;
+    ms->slave = false;
 
     object_property_add_str(obj, "accel",
                             machine_get_accel, machine_set_accel, NULL);
@@ -437,6 +452,13 @@ static void machine_initfn(Object *obj)
     object_property_set_description(obj, "suppress-vmdesc",
                                     "Set on to disable self-describing migration",
                                     NULL);
+    object_property_add_bool(obj, "slave",
+                             machine_get_slave,
+                             machine_set_slave,
+                             NULL);
+    object_property_set_description(obj, "slave",
+                                    "Enables a slave (remote) machine instance",
+                                    NULL);
 
     /* Register notifier when init is done for sysbus sanity checks */
     ms->sysbus_notifier.notify = machine_init_notify;
@@ -497,6 +519,11 @@ bool machine_mem_merge(MachineState *machine)
     return machine->mem_merge;
 }
 
+bool machine_slave(MachineState *machine)
+{
+    return machine->slave;
+}
+
 static const TypeInfo machine_info = {
     .name = TYPE_MACHINE,
     .parent = TYPE_OBJECT,
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 3e9a92c..523cfc2 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -40,6 +40,7 @@ int machine_kvm_shadow_mem(MachineState *machine);
 int machine_phandle_start(MachineState *machine);
 bool machine_dump_guest_core(MachineState *machine);
 bool machine_mem_merge(MachineState *machine);
+bool machine_slave(MachineState *machine);
 
 /**
  * MachineClass:
@@ -120,6 +121,7 @@ struct MachineState {
     char *firmware;
     bool iommu;
     bool suppress_vmdesc;
+    bool slave;
 
     ram_addr_t ram_size;
     ram_addr_t maxram_size;
diff --git a/qemu-options.hx b/qemu-options.hx
index 7e147b8..96300ba 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -41,7 +41,8 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
     "                igd-passthru=on|off controls IGD GFX passthrough support (default=off)\n"
     "                aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
     "                dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
-    "                suppress-vmdesc=on|off disables self-describing migration (default=off)\n",
+    "                suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
+    "                slave=on|off enables a slave (remote) machine instance (default=off)",
     QEMU_ARCH_ALL)
 STEXI
 @item -machine [type=]@var{name}[,prop=@var{value}[,...]]
@@ -80,6 +81,8 @@ execution of AES cryptographic functions.  The default is on.
 Enables or disables DEA key wrapping support on s390-ccw hosts. This feature
 controls whether DEA wrapping keys will be created to allow
 execution of DEA cryptographic functions.  The default is on.
+@item slave=on|off
+Enables a slave (remote) machine instance
 @end table
 ETEXI
 
diff --git a/util/qemu-config.c b/util/qemu-config.c
index 5fcfd0e..696408d 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -219,6 +219,11 @@ static QemuOptsList machine_opts = {
             .name = "suppress-vmdesc",
             .type = QEMU_OPT_BOOL,
             .help = "Set on to disable self-describing migration",
+        },{
+            .name = "slave",
+            .type = QEMU_OPT_BOOL,
+            .help = "Indicates the machine is a slave instance "
+                    "(e.g. remoteproc)",
         },
         { /* End of list */ }
     }
-- 
2.7.3

  parent reply	other threads:[~2016-03-18  9:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18  9:13 [Qemu-devel] [RFC v2 0/6] QEMU shared-memory backend Baptiste Reynal
2016-03-18  9:13 ` [Qemu-devel] [RFC v2 1/6] backend: shared memory backend Baptiste Reynal
2016-03-18  9:13 ` [Qemu-devel] [RFC v2 2/6] migration: add shared migration type Baptiste Reynal
2016-03-18  9:13 ` [Qemu-devel] [RFC v2 3/6] hw/misc: sdm signal shboot Baptiste Reynal
2016-03-18  9:13 ` Baptiste Reynal [this message]
2016-03-18  9:13 ` [Qemu-devel] [RFC v2 5/6] hw/arm: boot Baptiste Reynal
2016-03-18  9:13 ` [Qemu-devel] [RFC v2 6/6] qemu: numa Baptiste Reynal
2016-03-22 14:14 ` [Qemu-devel] [RFC v2 0/6] QEMU shared-memory backend Markus Armbruster
2016-03-22 14:54   ` Baptiste Reynal
2016-04-07 16:27     ` Markus Armbruster
2016-04-08 12:52       ` Baptiste Reynal
2016-04-08 13:59         ` Markus Armbruster
2016-03-31  9:14 ` Stefan Hajnoczi
2016-04-05 12:00   ` Baptiste Reynal
2016-04-06  8:57     ` Stefan Hajnoczi
2016-04-06 13:47       ` Igor Mammedov
2016-04-08 12:46         ` Baptiste Reynal

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=1458292438-13909-5-git-send-email-b.reynal@virtualopensystems.com \
    --to=b.reynal@virtualopensystems.com \
    --cc=Claudio.Fontana@huawei.com \
    --cc=Jani.Kokkonen@huawei.com \
    --cc=c.pinto@virtualopensystems.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tech@virtualopensystems.com \
    /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).