[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2 17/21] libxl: remove device model "none" support from stream functions
Remove the usage of device model "none" in the migration stream related functions. Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> --- Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> Cc: Wei Liu <wei.liu2@xxxxxxxxxx> --- tools/libxl/libxl_stream_read.c | 6 ++---- tools/libxl/libxl_stream_write.c | 11 ++--------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_read.c index 483875038c..fcb39ee7d5 100644 --- a/tools/libxl/libxl_stream_read.c +++ b/tools/libxl/libxl_stream_read.c @@ -584,8 +584,7 @@ static bool process_record(libxl__egc *egc, break; case REC_TYPE_EMULATOR_XENSTORE_DATA: - if (dcs->guest_config->b_info.device_model_version == - LIBXL_DEVICE_MODEL_VERSION_NONE) { + if (dcs->guest_config->b_info.type != LIBXL_DOMAIN_TYPE_HVM) { rc = ERROR_FAIL; LOG(ERROR, "Received a xenstore emulator record when none was expected"); @@ -613,8 +612,7 @@ static bool process_record(libxl__egc *egc, break; case REC_TYPE_EMULATOR_CONTEXT: - if (dcs->guest_config->b_info.device_model_version == - LIBXL_DEVICE_MODEL_VERSION_NONE) { + if (dcs->guest_config->b_info.type != LIBXL_DOMAIN_TYPE_HVM) { rc = ERROR_FAIL; LOG(ERROR, "Received an emulator context record when none was expected"); diff --git a/tools/libxl/libxl_stream_write.c b/tools/libxl/libxl_stream_write.c index c96a6a2c38..634f3240d1 100644 --- a/tools/libxl/libxl_stream_write.c +++ b/tools/libxl/libxl_stream_write.c @@ -181,7 +181,6 @@ static void setup_emulator_write(libxl__egc *egc, sws_record_done_cb cb) { assert(stream->emu_sub_hdr.id != EMULATOR_UNKNOWN); - assert(stream->device_model_version != LIBXL_DEVICE_MODEL_VERSION_NONE); setup_generic_write(egc, stream, what, hdr, emu_hdr, body, cb); } @@ -261,10 +260,6 @@ 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_UNKNOWN; - break; - default: rc = ERROR_FAIL; LOGD(ERROR, dss->domid, "Unknown emulator for HVM domain"); @@ -395,7 +390,7 @@ static void write_emulator_xenstore_record(libxl__egc *egc, char *buf = NULL; uint32_t len = 0; - if (stream->device_model_version == LIBXL_DEVICE_MODEL_VERSION_NONE) { + if (dss->type != LIBXL_DOMAIN_TYPE_HVM) { emulator_xenstore_record_done(egc, stream); return; } @@ -449,9 +444,7 @@ static void write_emulator_context_record(libxl__egc *egc, struct stat st; int rc; - assert(dss->type == LIBXL_DOMAIN_TYPE_HVM); - - if (stream->device_model_version == LIBXL_DEVICE_MODEL_VERSION_NONE) { + if (dss->type != LIBXL_DOMAIN_TYPE_HVM) { emulator_context_record_done(egc, stream); return; } -- 2.11.0 (Apple Git-81) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |