On 18/07/14 22:01, Alexander Graf wrote:
On 18.07.14 13:59, Eric Blake wrote:
On 07/17/2014 10:31 PM, cyril...@gmail.com wrote:
It may prove useful know which Linux distribution version the host
machine
is running when an issue in the guest arises but a user cannot access
the host.
Signed-off-by: Cyril Bur <cyril....@au1.ibm.com>
---
hw/ppc/spapr.c | 8 +++++++
target-ppc/kvm.c | 62
++++++++++++++++++++++++++++++++++++++++++++++++++++
target-ppc/kvm_ppc.h | 6 +++++
3 files changed, 76 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 6b48a26..391d47a 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -375,6 +375,14 @@ static void *spapr_create_fdt_skel(hwaddr
initrd_base,
_FDT((fdt_property_string(fdt, "vm,uuid", buf)));
g_free(buf);
+ /*
+ * Add info to the guest FDT to tell it what linux the host is
+ */
+ if (kvmppc_get_linux_host(&buf)) {
+ _FDT((fdt_property_string(fdt, "linux,host", buf)));
+ g_free(buf);
+ }
Ouch. What does this do for migration? By exposing it to the guest,
you have made it part of the guest ABI, and now you have limited
yourself to migrate only when the destination host is identical to the
source if you don't want to risk breaking the guest. Without this, it
seems feasible to migrate from a machine on an older host to another
machine on a newer host.
sPAPR has a mechanism to inject a "post-migration" interrupt into the
guest and provide a device tree diff. That way we can change these
host specific values on the fly after migration happened.
Maybe it makes sense to hold off these host specific device tree
chunks until after we have that mechanism implemented though.
Indeed and the ability to do this is in the kernel but it had not been
implemented in qemu yet. Probably not worth doing just for this patch
but having this does open the doors to quite a few other things, I'll
investigate.
Cyril
Alex