[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v6 29/29] libxl: add support for migrating HVM guests without a device model
Only some minor libxl changes are needed in order to be able to migrate HVM guests without a device model, no hypervisor changes are needed. This change adds support for LIBXL_DEVICE_MODEL_VERSION_NONE into the migration code. Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx> Cc: Wei Liu <wei.liu2@xxxxxxxxxx> --- tools/libxl/libxl_dom.c | 3 +++ tools/libxl/libxl_dom_suspend.c | 4 ++++ tools/libxl/libxl_sr_stream_format.h | 1 + tools/libxl/libxl_stream_write.c | 9 ++++++++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index b82b938..1566456 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -1308,6 +1308,9 @@ void libxl__domain_suspend_common_switch_qemu_logdirty case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: domain_suspend_switch_qemu_xen_logdirty(domid, enable, shs); break; + case LIBXL_DEVICE_MODEL_VERSION_NONE: + libxl__xc_domain_saverestore_async_callback_done(egc, shs, 0); + break; default: LOG(ERROR,"logdirty switch failed" ", no valid device model version found, abandoning suspend"); diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c index 4cc01ad..7205e60 100644 --- a/tools/libxl/libxl_dom_suspend.c +++ b/tools/libxl/libxl_dom_suspend.c @@ -43,6 +43,8 @@ int libxl__domain_suspend_device_model(libxl__gc *gc, if (ret) unlink(filename); break; + case LIBXL_DEVICE_MODEL_VERSION_NONE: + break; default: return ERROR_INVAL; } @@ -394,6 +396,8 @@ int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid) if (libxl__qmp_resume(gc, domid)) return ERROR_FAIL; break; + case LIBXL_DEVICE_MODEL_VERSION_NONE: + break; default: return ERROR_INVAL; } diff --git a/tools/libxl/libxl_sr_stream_format.h b/tools/libxl/libxl_sr_stream_format.h index 54da360..960211c 100644 --- a/tools/libxl/libxl_sr_stream_format.h +++ b/tools/libxl/libxl_sr_stream_format.h @@ -46,6 +46,7 @@ typedef struct libxl__sr_emulator_hdr #define EMULATOR_UNKNOWN 0x00000000U #define EMULATOR_QEMU_TRADITIONAL 0x00000001U #define EMULATOR_QEMU_UPSTREAM 0x00000002U +#define EMULATOR_NONE 0x00000003U #endif /* LIBXL__SR_STREAM_FORMAT_H */ diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c index 52a60d7..aa0a5e5 100644 --- a/tools/libxl/libxl_stream_write.c +++ b/tools/libxl/libxl_stream_write.c @@ -232,6 +232,10 @@ void libxl__stream_write_start(libxl__egc *egc, stream->emu_sub_hdr.id = EMULATOR_QEMU_UPSTREAM; break; + case LIBXL_DEVICE_MODEL_VERSION_NONE: + stream->emu_sub_hdr.id = EMULATOR_NONE; + break; + default: rc = ERROR_FAIL; LOG(ERROR, "Unknown emulator for HVM domain"); @@ -387,8 +391,11 @@ static void emulator_xenstore_record_done(libxl__egc *egc, libxl__stream_write_state *stream) { libxl__domain_suspend_state *dss = stream->dss; + STATE_AO_GC(stream->ao); - if (dss->type == LIBXL_DOMAIN_TYPE_HVM) + if (dss->type == LIBXL_DOMAIN_TYPE_HVM && + libxl__device_model_version_running(gc, dss->domid) != + LIBXL_DEVICE_MODEL_VERSION_NONE) write_emulator_context_record(egc, stream); else { if (stream->in_checkpoint) -- 1.9.5 (Apple Git-50.3) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |