From nobody Sun May 5 12:45:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1578072235; cv=none; d=zohomail.com; s=zohoarc; b=mBD9baLjOxX1TkK41c+vUBu3Zdrzl0ZRzGzxax1Tzqq7I0POnbD13/wPkKvG2gn3+wiblgqGpK+SOZKrP6FC2Ko6QNjf72cmKVslp6zXBoeSxStgxSGT5oZMIb9W6FEDcitPnwfm6Lmsqx00pNIxCvYBY/iTHsYjnR/cEIWEEMc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578072235; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=sk9aRysS/nxVd4NZTk+v7EgOr8V7WOdt/FvdW/XgQVE=; b=br8Qf9oTfdOOmotbNblocT1hNB/m/y44HbdQEwv5yN8gu2v8thXPmrLMVdOT4bx/p1CfDE02XNs35De6fryvMQf0HsiqUdeEipfF8gBV+EhoEAMGmDGLRS6D427c/PaBGRxsLQyBz6sdsqZfwVTIG2jOe3fow7JvD06pYDj3PqA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1578072235733555.2791093289347; Fri, 3 Jan 2020 09:23:55 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inQf9-0005FW-WC; Fri, 03 Jan 2020 17:23:03 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inQf8-0005FR-Fa for xen-devel@lists.xenproject.org; Fri, 03 Jan 2020 17:23:02 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ac6c840a-2e4d-11ea-b6f1-bc764e2007e4; Fri, 03 Jan 2020 17:22:53 +0000 (UTC) X-Inumbo-ID: ac6c840a-2e4d-11ea-b6f1-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578072173; h=from:to:cc:subject:date:message-id:mime-version; bh=Fg550LMtLKRTATrEdHKj6tLpDYdWVvgTQjiw3oNQDtw=; b=cIO9YPwUpe9WGIa5HiR6iAehfpGmIyDlB5ggB1tzWiPhEq1sBgZ2FFb7 KjIFVDSbHjCoPuOsjga5Kp6NPKFdZf0gyWtzIa+nmsAPdr4gX4lkHLuK7 zu73nvlicBPGtJzerqADjWjLgwBPI0HEA8PDDrPmy1CcWSmI9cQJJvKE3 g=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: zNddPgR40qFabReP/M7f0/bZMLEUcvD3g8dFUqDCmCRGrhHhYlXowkGVwRPq8l3oHre3ROMFAp fvDNhwGM8vzpe3FNBUo8dpg1Ebgbaxbgvzck7t55rGTczuyNGKvb2Ld0hBnptgwFIPS/L6YkU3 DUAL/kwFGXRcWWBI+S4ZgSOyPtVmz0SGte+CR4FRjXu42aAl/7+Qdc1DrCD1wBu5AejlrIublX HenY/csX5FdB52A1pz4i8Chtx0ALgGX75Yl4nmCUsb3ewt+fmcvMKo3zbtqA3jhifFfHppXHjk llQ= X-SBRS: 2.7 X-MesageID: 10446048 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,391,1571716800"; d="scan'208";a="10446048" From: Andrew Cooper To: Xen-devel Date: Fri, 3 Jan 2020 17:22:48 +0000 Message-ID: <20200103172248.22407-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] tools/restore: Drop unused parameters from xc_domain_restore() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Ian Jackson Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The hvm and pae parameters are a remnant of legacy migration. They have 0 passed in from libxl_stream_read.c's process_record(), and are discarded in xc_domain_restore(). While dropping these, update the doxygen comment to be accurate, and simpli= fy the other hvm vs pv handling in xc_domain_restore(). No functional change. Signed-off-by: Andrew Cooper Acked-by: Wei Liu --- CC: Ian Jackson CC: Wei Liu --- tools/libxc/include/xenguest.h | 26 +++++++++++++++----------- tools/libxc/xc_sr_restore.c | 23 +++++++---------------- tools/libxl/libxl_internal.h | 3 +-- tools/libxl/libxl_save_callout.c | 4 +--- tools/libxl/libxl_save_helper.c | 5 +---- tools/libxl/libxl_stream_read.c | 2 +- 6 files changed, 26 insertions(+), 37 deletions(-) diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h index b4b2e19619..fdb03e32da 100644 --- a/tools/libxc/include/xenguest.h +++ b/tools/libxc/include/xenguest.h @@ -181,23 +181,27 @@ struct restore_callbacks { * * Domain is restored in a suspended state ready to be unpaused. * - * @parm xch a handle to an open hypervisor interface - * @parm fd the file descriptor to restore a domain from - * @parm dom the id of the domain - * @parm store_evtchn the store event channel for this domain to use - * @parm store_mfn returned with the mfn of the store page - * @parm hvm non-zero if this is a HVM restore - * @parm pae non-zero if this HVM domain has PAE support enabled - * @parm stream_type non-zero if the far end of the stream is using checkp= ointing - * @parm callbacks non-NULL to receive a callback to restore toolstack - * specific data + * @param xch a handle to an open hypervisor interface + * @param io_fd the file descriptor to restore a domain from + * @param dom the id of the domain + * @param store_evtchn the xenstore event channel for this domain to use + * @param store_mfn filled with the gfn of the store page + * @param store_domid the backend domain for xenstore + * @param console_evtchn the console event channel for this domain to use + * @param console_mfn filled with the gfn of the console page + * @param console_domid the backend domain for xenconsole + * @param stream_type XC_MIG_STREAM_NONE if the far end of the stream is u= sing + * checkpointing + * @param callbacks non-NULL to receive a callback to restore toolstack + * specific data + * @param recv_df Only used for XC_MIG_STREAM_COLO. Contains backchannel = to + * the source side. * @return 0 on success, -1 on failure */ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom, unsigned int store_evtchn, unsigned long *store_mfn, uint32_t store_domid, unsigned int console_evtchn, unsigned long *console_mfn, uint32_t console_domid, - unsigned int hvm, unsigned int pae, xc_migration_stream_t stream_type, struct restore_callbacks *callbacks, int send_back_f= d); =20 diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c index 98038096c7..19442c3453 100644 --- a/tools/libxc/xc_sr_restore.c +++ b/tools/libxc/xc_sr_restore.c @@ -833,7 +833,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uin= t32_t dom, unsigned int store_evtchn, unsigned long *store_mfn, uint32_t store_domid, unsigned int console_evtchn, unsigned long *console_gfn, uint32_t console_domid, - unsigned int hvm, unsigned int pae, xc_migration_stream_t stream_type, struct restore_callbacks *callbacks, int send_back_f= d) { @@ -866,9 +865,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uin= t32_t dom, callbacks->restore_results); } =20 - DPRINTF("fd %d, dom %u, hvm %u, pae %u, stream_type %d", - io_fd, dom, hvm, pae, stream_type); - if ( xc_domain_getinfo(xch, dom, 1, &ctx.dominfo) !=3D 1 ) { PERROR("Failed to get domain info"); @@ -881,6 +877,9 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uin= t32_t dom, return -1; } =20 + DPRINTF("fd %d, dom %u, hvm %u, stream_type %d", + io_fd, dom, ctx.dominfo.hvm, stream_type); + ctx.domid =3D dom; =20 if ( read_headers(&ctx) ) @@ -893,19 +892,11 @@ int xc_domain_restore(xc_interface *xch, int io_fd, u= int32_t dom, } =20 ctx.restore.p2m_size =3D nr_pfns; + ctx.restore.ops =3D ctx.dominfo.hvm + ? restore_ops_x86_hvm : restore_ops_x86_pv; =20 - if ( ctx.dominfo.hvm ) - { - ctx.restore.ops =3D restore_ops_x86_hvm; - if ( restore(&ctx) ) - return -1; - } - else - { - ctx.restore.ops =3D restore_ops_x86_pv; - if ( restore(&ctx) ) - return -1; - } + if ( restore(&ctx) ) + return -1; =20 IPRINTF("XenStore: mfn %#"PRIpfn", dom %d, evt %u", ctx.restore.xenstore_gfn, diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index b5adbfe4b7..a99f3627e4 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -4199,8 +4199,7 @@ _hidden int libxl__restore_emulator_xenstore_data /* calls libxl__xc_domain_restore_done when done */ _hidden void libxl__xc_domain_restore(libxl__egc *egc, libxl__domain_create_state *dcs, - libxl__save_helper_state *shs, - int hvm, int pae); + libxl__save_helper_state *shs); /* If rc=3D=3D0 then retval is the return value from xc_domain_save * and errnoval is the errno value it provided. * If rc!=3D0, retval and errnoval are undefined. */ diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_call= out.c index 6452d70036..caa1396813 100644 --- a/tools/libxl/libxl_save_callout.c +++ b/tools/libxl/libxl_save_callout.c @@ -42,8 +42,7 @@ static void helper_done(libxl__egc *egc, libxl__save_help= er_state *shs); /*----- entrypoints -----*/ =20 void libxl__xc_domain_restore(libxl__egc *egc, libxl__domain_create_state = *dcs, - libxl__save_helper_state *shs, - int hvm, int pae) + libxl__save_helper_state *shs) { STATE_AO_GC(dcs->ao); =20 @@ -61,7 +60,6 @@ void libxl__xc_domain_restore(libxl__egc *egc, libxl__dom= ain_create_state *dcs, state->store_port, state->store_domid, state->console_port, state->console_domid, - hvm, pae, cbflags, dcs->restore_params.checkpointed_stream, }; =20 diff --git a/tools/libxl/libxl_save_helper.c b/tools/libxl/libxl_save_helpe= r.c index 38089a002d..cdad40be4f 100644 --- a/tools/libxl/libxl_save_helper.c +++ b/tools/libxl/libxl_save_helper.c @@ -275,8 +275,6 @@ int main(int argc, char **argv) domid_t store_domid =3D strtoul(NEXTARG,0,10); unsigned console_evtchn =3D strtoul(NEXTARG,0,10); domid_t console_domid =3D strtoul(NEXTARG,0,10); - unsigned int hvm =3D strtoul(NEXTARG,0,10); - unsigned int pae =3D strtoul(NEXTARG,0,10); unsigned cbflags =3D strtoul(NEXTARG,0,10); xc_migration_stream_t stream_type =3D strtoul(NEXTARG,0,10); assert(!*++argv); @@ -291,8 +289,7 @@ int main(int argc, char **argv) =20 r =3D xc_domain_restore(xch, io_fd, dom, store_evtchn, &store_mfn, store_domid, console_evtchn, &console_mfn, - console_domid, hvm, pae, - stream_type, + console_domid, stream_type, &helper_restore_callbacks, send_back_fd); helper_stub_restore_results(store_mfn,console_mfn,0); complete(r); diff --git a/tools/libxl/libxl_stream_read.c b/tools/libxl/libxl_stream_rea= d.c index fcb39ee7d5..514f6d9f89 100644 --- a/tools/libxl/libxl_stream_read.c +++ b/tools/libxl/libxl_stream_read.c @@ -580,7 +580,7 @@ static bool process_record(libxl__egc *egc, break; =20 case REC_TYPE_LIBXC_CONTEXT: - libxl__xc_domain_restore(egc, dcs, &stream->shs, 0, 0); + libxl__xc_domain_restore(egc, dcs, &stream->shs); break; =20 case REC_TYPE_EMULATOR_XENSTORE_DATA: --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel