[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 1/2] [RFC] arm: Introduce hostinvariant command l
From: |
mjaggi |
Subject: |
[Qemu-devel] [PATCH v2 1/2] [RFC] arm: Introduce hostinvariant command line option |
Date: |
Tue, 23 Oct 2018 09:31:18 +0000 |
From: Manish Jaggi <address@hidden>
This option is user opt-in. hostinvariant will replace guest's invariant
registers with hosts.
Signed-off-by: Manish Jaggi <address@hidden>
diff --git a/qemu-options.hx b/qemu-options.hx
index 654ef48..d8c0da7 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3896,6 +3896,19 @@ STEXI
prepend a timestamp to each log message.(default:on)
ETEXI
+DEF("hostinvariant", HAS_ARG, QEMU_OPTION_hostinvariant,
+ "-hostinvariant enable[=on|off]\n"
+ " migrated guest should use invariant register values of
host\n"
+ " on|off controls migration between arch64 systems using
-cpu host but with different MIDR values (default:off)\n",
+ QEMU_ARCH_ARM)
+STEXI
address@hidden -hostinvariant enable[=on|off]
address@hidden -hostinvariant
+controls migration between arch64 systems using -cpu host but with different
MIDR values.(default:off)
+ETEXI
+
+
+
DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate,
"-dump-vmstate <file>\n"
" Output vmstate information in JSON format to file.\n"
diff --git a/vl.c b/vl.c
index 5ba06ad..b6df5f0 100644
--- a/vl.c
+++ b/vl.c
@@ -144,6 +144,7 @@ const char *mem_path = NULL;
int mem_prealloc = 0; /* force preallocation of physical target memory */
bool enable_mlock = false;
bool enable_cpu_pm = false;
+bool enable_hostinvariant = false;
int nb_nics;
NICInfo nd_table[MAX_NICS];
int autostart;
@@ -420,6 +421,19 @@ static QemuOptsList qemu_msg_opts = {
},
};
+static QemuOptsList qemu_hostinvariant_opts = {
+ .name = "hostinvariant",
+ .head = QTAILQ_HEAD_INITIALIZER(qemu_hostinvariant_opts.head),
+ .desc = {
+ {
+ .name = "enable",
+ .type = QEMU_OPT_BOOL,
+ },
+ { /* end of list */ }
+ },
+};
+
+
static QemuOptsList qemu_name_opts = {
.name = "name",
.implied_opt_name = "guest",
@@ -2989,6 +3003,7 @@ int main(int argc, char **argv, char **envp)
qemu_add_opts(&qemu_realtime_opts);
qemu_add_opts(&qemu_overcommit_opts);
qemu_add_opts(&qemu_msg_opts);
+ qemu_add_opts(&qemu_hostinvariant_opts);
qemu_add_opts(&qemu_name_opts);
qemu_add_opts(&qemu_numa_opts);
qemu_add_opts(&qemu_icount_opts);
@@ -3948,6 +3963,15 @@ int main(int argc, char **argv, char **envp)
}
configure_msg(opts);
break;
+ case QEMU_OPTION_hostinvariant:
+ opts =
qemu_opts_parse_noisily(qemu_find_opts("hostinvariant"), optarg,
+ false);
+ if (!opts) {
+ exit(1);
+ }
+ enable_hostinvariant = qemu_opt_get_bool(opts,
"hostinvariant", true);
+ error_report("Host Invariant=%d", enable_hostinvariant);
+ break;
case QEMU_OPTION_dump_vmstate:
if (vmstate_dump_file) {
error_report("only one '-dump-vmstate' "
--
1.8.3.1