@@ -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");
@@ -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;
}
Remove the usage of device model "none" in the migration stream related functions. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> --- Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> --- tools/libxl/libxl_stream_read.c | 6 ++---- tools/libxl/libxl_stream_write.c | 11 ++--------- 2 files changed, 4 insertions(+), 13 deletions(-)