[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/12] xen: Expect xenstore write to fail when restr
From: |
Ian Jackson |
Subject: |
[Qemu-devel] [PATCH 11/12] xen: Expect xenstore write to fail when restricted |
Date: |
Thu, 8 Mar 2018 19:03:06 +0000 |
From: Ross Lagerwall <address@hidden>
Saving the current state to xenstore may fail when running restricted
(in particular, after a migration). Therefore, don't report the error or
exit when running restricted. Toolstacks that want to allow running
QEMU restricted should instead make use of QMP events to listen for
state changes.
CC: Ian Jackson <address@hidden>
Signed-off-by: Ross Lagerwall <address@hidden>
Reviewed-by: Ian Jackson <address@hidden>
---
v6: New patch in this version of the series
---
hw/xen/xen-common.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/xen/xen-common.c b/hw/xen/xen-common.c
index f73b416..8ede246 100644
--- a/hw/xen/xen-common.c
+++ b/hw/xen/xen-common.c
@@ -101,7 +101,12 @@ static void xenstore_record_dm_state(struct xs_handle *xs,
const char *state)
}
snprintf(path, sizeof (path), "device-model/%u/state", xen_domid);
- if (!xs_write(xs, XBT_NULL, path, state, strlen(state))) {
+ /*
+ * This call may fail when running restricted so don't make it fatal in
+ * that case. Toolstacks should instead use QMP to listen for state
changes.
+ */
+ if (!xs_write(xs, XBT_NULL, path, state, strlen(state)) &&
+ !xen_domid_restrict) {
error_report("error recording dm state");
exit(1);
}
--
2.1.4
- Re: [Qemu-devel] [PATCH v6.1 00/11] xen: xen-domid-restrict improvements, Ian Jackson, 2018/03/08
- [Qemu-devel] [PATCH 04/12] xen: defer call to xen_restrict until just before os_setup_post, Ian Jackson, 2018/03/08
- [Qemu-devel] [PATCH 07/12] xen: destroy_hvm_domain: Try xendevicemodel_shutdown, Ian Jackson, 2018/03/08
- [Qemu-devel] [PATCH 09/12] configure: do_compiler: Dump some extra info under bash, Ian Jackson, 2018/03/08
- [Qemu-devel] [PATCH 02/12] xen: link against xentoolcore, Ian Jackson, 2018/03/08
- [Qemu-devel] [PATCH 05/12] xen: destroy_hvm_domain: Move reason into a variable, Ian Jackson, 2018/03/08