From patchwork Mon Sep 25 10:52:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9969707 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 85092602D8 for ; Mon, 25 Sep 2017 10:56:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C25328BAA for ; Mon, 25 Sep 2017 10:56:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 710C628BFF; Mon, 25 Sep 2017 10:56:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 786C328BAA for ; Mon, 25 Sep 2017 10:56:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwR1x-00005O-Bq; Mon, 25 Sep 2017 10:54:29 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwR1x-0008WB-1S for xen-devel@lists.xenproject.org; Mon, 25 Sep 2017 10:54:29 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id 14/4A-02048-460E8C95; Mon, 25 Sep 2017 10:54:28 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsXitHRDpG7ygxO RBje3mVh83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBknv6xhK5ghUXHr/TmmBsYfQl2MnBwSAv4S y89OYQGx2QR0JC7O3cnWxcjBISKgInF7r0EXIxcHs8BBRoljT/aygsSFBSIlLnVWg5SzCKhKn G3ZBdbKK2Alsef9AyaQEgkBPYkf2w1BTE6g8OelSSAVQgKWEge+97JBVAtKnJz5BKyTWUBTon X7b3YIW16ieetsZoh6RYn+eQ/YJjDyzULSMgtJyywkLQsYmVcxqhenFpWlFuka6iUVZaZnlOQ mZuboGhoY6+WmFhcnpqfmJCYV6yXn525iBAYZAxDsYFz+0ekQoyQHk5Io712+E5FCfEn5KZUZ icUZ8UWlOanFhxhlODiUJHjX3gfKCRalpqdWpGXmAMMdJi3BwaMkwisEkuYtLkjMLc5Mh0idY tTl6Lh59w+TEEtefl6qlDjvTpAiAZCijNI8uBGw2LvEKCslzMsIdJQQT0FqUW5mCar8K0ZxDk YlYd5AkCk8mXklcJteAR3BBHRE71SwI0oSEVJSDYwGvyebT2twNmTsn2ba9GyR/JKcydqvOub kO3OfmPfg7onrrV91OcNvn53ypDIreKfTI23DteUOn/a+TRXS33LA8ppDf6nYjDWOnw+/2W/1 4bzHx0nrp1054PChIqG5RuKh4YuSyv3RkStqtnBdf9iyRNXSub3bSevXz5vuObsLTdec+TPB/ JOVEktxRqKhFnNRcSIATCFNYLgCAAA= X-Env-Sender: prvs=43456bc54=roger.pau@citrix.com X-Msg-Ref: server-11.tower-31.messagelabs.com!1506336866!85426181!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 21025 invoked from network); 25 Sep 2017 10:54:27 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-11.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 25 Sep 2017 10:54:27 -0000 X-IronPort-AV: E=Sophos;i="5.42,435,1500940800"; d="scan'208";a="441052552" From: Roger Pau Monne To: Date: Mon, 25 Sep 2017 11:52:02 +0100 Message-ID: <20170925105206.66507-19-roger.pau@citrix.com> X-Mailer: git-send-email 2.13.5 (Apple Git-94) In-Reply-To: <20170925105206.66507-1-roger.pau@citrix.com> References: <20170925105206.66507-1-roger.pau@citrix.com> MIME-Version: 1.0 Cc: wei.liu2@citrix.com, boris.ostrovsky@oracle.com, Roger Pau Monne , Ian Jackson Subject: [Xen-devel] [PATCH v3 18/22] libxl: remove device model "none" support from stream functions X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Remove the usage of device model "none" in the migration stream related functions. Signed-off-by: Roger Pau Monné Acked-by: Ian Jackson --- Cc: Ian Jackson Cc: Wei Liu --- 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; }