From patchwork Tue Aug 22 09:49:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Roger Pau Monne X-Patchwork-Id: 9914639 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 AC896600C5 for ; Tue, 22 Aug 2017 09:51:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD41528863 for ; Tue, 22 Aug 2017 09:51:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1DB328864; Tue, 22 Aug 2017 09:51:49 +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 4D39528863 for ; Tue, 22 Aug 2017 09:51:49 +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 1dk5p4-0006Fs-SQ; Tue, 22 Aug 2017 09:50:10 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dk5p2-0006DE-Vk for xen-devel@lists.xenproject.org; Tue, 22 Aug 2017 09:50:09 +0000 Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id C6/CE-01987-05EFB995; Tue, 22 Aug 2017 09:50:08 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDIsWRWlGSWpSXmKPExsXitHRDpK7/v9m RBq2PdS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oy5d6YxF8yQqDi96D9jA+MPoS5GDg4JAX+J CWt4uxg5OdgEdCQuzt3JBhIWEVCRuL3XoIuRi4NZYA2jxPk5f9hBaoQFwiQ+vNkGZrMIqErs2 HKfEcTmFbCS2Hr/MCuILSGgJ/F24guwOCdQ/PDeJ2C2kIClxMaPP1kh6gUlTs58wgJiMwtoSr Ru/80OYctLNG+dzQxRryjRP+8B2wRGvllIWmYhaZmFpGUBI/MqRo3i1KKy1CJdYwO9pKLM9Iy S3MTMHF1DA2O93NTi4sT01JzEpGK95PzcTYzAUKtnYGDcwdh5wu8QoyQHk5Io7+TvsyOF+JLy UyozEosz4otKc1KLDzHKcHAoSfCy/QXKCRalpqdWpGXmAIMeJi3BwaMkwvv4D1Cat7ggMbc4M x0idYpRUUqc9wdIQgAkkVGaB9cGi7RLjLJSwryMDAwMQjwFqUW5mSWo8q8YxTkYlYR5X4BM4c nMK4Gb/gpoMRPQYsPWaSCLSxIRUlINjPp/N69/rjzFcPsCnk2nG3u8RKpsFNW+eya27TFXV/a /p37r9szSa9vyTE62MhS9jHAqPFI8ec0CQ+2VVoJxaxcHFzPslZ+X/zonbub7NdZ8fu4vRCe8 j6579WshZ8nVs/qm5py/vW/EXra5tG1Ohkj5nLwTP2e3CFzqrvK6rBzFe1w+PMl/uhJLcUaio RZzUXEiAO3ffcuvAgAA X-Env-Sender: prvs=400f1e73e=roger.pau@citrix.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1503395402!111036246!3 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 63592 invoked from network); 22 Aug 2017 09:50:07 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-3.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 22 Aug 2017 09:50:07 -0000 X-IronPort-AV: E=Sophos;i="5.41,411,1498521600"; d="scan'208";a="436366316" From: Roger Pau Monne To: Date: Tue, 22 Aug 2017 10:49:16 +0100 Message-ID: <20170822094920.70151-16-roger.pau@citrix.com> X-Mailer: git-send-email 2.11.0 (Apple Git-81) In-Reply-To: <20170822094920.70151-1-roger.pau@citrix.com> References: <20170822094920.70151-1-roger.pau@citrix.com> MIME-Version: 1.0 Cc: Wei Liu , boris.ostrovsky@oracle.com, Roger Pau Monne , Ian Jackson Subject: [Xen-devel] [PATCH 15/19] 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é --- 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; }