From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH v5] libxl: fix migration of PV and PVH domUs with and without qemu Date: Tue, 14 May 2019 10:14:52 +0200 Message-ID: <20190514101452.10c40b6e.olaf@aepfle.de> References: <20190514080558.14540-1-olaf@aepfle.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0975701872615336832==" Return-path: Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQSaY-0000w9-4b for xen-devel@lists.xenproject.org; Tue, 14 May 2019 08:15:06 +0000 In-Reply-To: <20190514080558.14540-1-olaf@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" To: xen-devel@lists.xenproject.org Cc: Anthony PERARD , Wei Liu , Ian Jackson , Roger Pau =?UTF-8?B?TW9ubsOp?= List-Id: xen-devel@lists.xenproject.org --===============0975701872615336832== Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/8_sG1PWKO5Z3DkANiIxesBR"; protocol="application/pgp-signature" --Sig_/8_sG1PWKO5Z3DkANiIxesBR Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Am Tue, 14 May 2019 10:05:58 +0200 schrieb Olaf Hering : > @@ -459,7 +461,9 @@ int libxl__domain_resume(libxl__gc *gc, uint32_t domi= d, int suspend_cancel) > goto out; > } > =20 > - if (type =3D=3D LIBXL_DOMAIN_TYPE_HVM) { > + if (type =3D=3D LIBXL_DOMAIN_TYPE_HVM || > + libxl__device_model_version_running(gc, domid) =3D=3D > + LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { > rc =3D libxl__domain_resume_device_model(gc, domid); > if (rc) { > LOGD(ERROR, domid, "failed to resume device model:%d", rc); I think this could be done like that instead, so that libxl__device_model_v= ersion_running is called just once: --- a/tools/libxl/libxl_dom_suspend.c +++ b/tools/libxl/libxl_dom_suspend.c @@ -444,6 +444,8 @@ int libxl__domain_resume_device_model(libxl__gc *gc, ui= nt32_t domid) if (libxl__qmp_resume(gc, domid)) return ERROR_FAIL; break; + case LIBXL_DEVICE_MODEL_VERSION_NONE: + break; default: return ERROR_INVAL; } @@ -461,14 +463,10 @@ int libxl__domain_resume(libxl__gc *gc, uint32_t domi= d, int suspend_cancel) goto out; } =20 - if (type =3D=3D LIBXL_DOMAIN_TYPE_HVM || - libxl__device_model_version_running(gc, domid) =3D=3D - LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { - rc =3D libxl__domain_resume_device_model(gc, domid); - if (rc) { - LOGD(ERROR, domid, "failed to resume device model:%d", rc); - goto out; - } + rc =3D libxl__domain_resume_device_model(gc, domid); + if (rc) { + LOGD(ERROR, domid, "failed to resume device model:%d", rc); + goto out; } =20 if (xc_domain_resume(CTX->xch, domid, suspend_cancel)) { While it is easy for the resume path, doing the same in the suspend path needs more changes. libxl__domain_suspend_device_model would need to receive the callback and set it if a device model is active. Should this be done on top of this change? Olaf --Sig_/8_sG1PWKO5Z3DkANiIxesBR Content-Type: application/pgp-signature Content-Description: Digitale Signatur von OpenPGP -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSkRyP6Rn//f03pRUBdQqD6ppg2fgUCXNp4/AAKCRBdQqD6ppg2 fuF0AJ45yZ0+FmU4ej3jZBqXIeadW51Q1QCgm9BbTkX9BDcF1hjKCBRDtvz7+mw= =0uEf -----END PGP SIGNATURE----- --Sig_/8_sG1PWKO5Z3DkANiIxesBR-- --===============0975701872615336832== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmcKaHR0cHM6Ly9saXN0 cy54ZW5wcm9qZWN0Lm9yZy9tYWlsbWFuL2xpc3RpbmZvL3hlbi1kZXZlbA== --===============0975701872615336832==-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 047DBC04AB4 for ; Tue, 14 May 2019 08:15:36 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C524E2084A for ; Tue, 14 May 2019 08:15:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=aepfle.de header.i=@aepfle.de header.b="m1WAOCHt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C524E2084A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=aepfle.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQSaZ-0000wF-VR; Tue, 14 May 2019 08:15:07 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQSaY-0000w9-4b for xen-devel@lists.xenproject.org; Tue, 14 May 2019 08:15:06 +0000 X-Inumbo-ID: 60329018-7620-11e9-8980-bc764e045a96 Received: from mo6-p01-ob.smtp.rzone.de (unknown [2a01:238:20a:202:5301::6]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 60329018-7620-11e9-8980-bc764e045a96; Tue, 14 May 2019 08:15:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1557821703; s=strato-dkim-0002; d=aepfle.de; h=References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=Lm8jE2+HzjJITXBz+9sesjLf+bWU/BNjPMQioBLOLOU=; b=m1WAOCHtPhLeJSB0fqY6J4mpmZ48coWEVx+YAvNslGTxtg1PCxZmkqO4HC3XubKq5F voXpnp1hEgojtP5/uNr16zlTDvs1EG2/FRJR+E3Pl6te3lyvnv9Qln+u/gS4hpKqAoSV rOYZUuTeyIl1OAF3YAWX+hRBj41JBxGxnSuOSd5eQsVCKUbrrAzawKIJaHk0WrG/5Omf kRySJtM0ZMI+JZDxWH+jBYuGPi++pSw8lOGnNkHsS6grkop9zAekqgMA8+aw4QsL0N4X HaDPxiXuPGSAgHw9po4uGbWR/RvMdtr8QSVe3yEwc86Vd/UxjRdMp+40jdSTTZp6nOh8 0OQw== X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QED/SSGq+wjGiUC4AUztn93FPS2dyuYMxvZg==" X-RZG-CLASS-ID: mo00 Received: from sender by smtp.strato.de (RZmta 44.20 DYNA|AUTH) with ESMTPSA id U080cav4E8Eu4QB (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Tue, 14 May 2019 10:14:56 +0200 (CEST) Date: Tue, 14 May 2019 10:14:52 +0200 From: Olaf Hering To: xen-devel@lists.xenproject.org Message-ID: <20190514101452.10c40b6e.olaf@aepfle.de> In-Reply-To: <20190514080558.14540-1-olaf@aepfle.de> References: <20190514080558.14540-1-olaf@aepfle.de> X-Mailer: Claws Mail 2019.04.26 (GTK+ 2.24.32; x86_64-suse-linux-gnu) MIME-Version: 1.0 Subject: Re: [Xen-devel] [PATCH v5] libxl: fix migration of PV and PVH domUs with and without qemu 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: Anthony PERARD , Wei Liu , Ian Jackson , Roger Pau =?UTF-8?B?TW9ubsOp?= Content-Type: multipart/mixed; boundary="===============0975701872615336832==" Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Message-ID: <20190514081452.Cq9w59YseYR0oFuTsjAdQ56lw2Mi53AWFNxJ7etkpaI@z> --===============0975701872615336832== Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/8_sG1PWKO5Z3DkANiIxesBR"; protocol="application/pgp-signature" --Sig_/8_sG1PWKO5Z3DkANiIxesBR Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Am Tue, 14 May 2019 10:05:58 +0200 schrieb Olaf Hering : > @@ -459,7 +461,9 @@ int libxl__domain_resume(libxl__gc *gc, uint32_t domi= d, int suspend_cancel) > goto out; > } > =20 > - if (type =3D=3D LIBXL_DOMAIN_TYPE_HVM) { > + if (type =3D=3D LIBXL_DOMAIN_TYPE_HVM || > + libxl__device_model_version_running(gc, domid) =3D=3D > + LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { > rc =3D libxl__domain_resume_device_model(gc, domid); > if (rc) { > LOGD(ERROR, domid, "failed to resume device model:%d", rc); I think this could be done like that instead, so that libxl__device_model_v= ersion_running is called just once: --- a/tools/libxl/libxl_dom_suspend.c +++ b/tools/libxl/libxl_dom_suspend.c @@ -444,6 +444,8 @@ int libxl__domain_resume_device_model(libxl__gc *gc, ui= nt32_t domid) if (libxl__qmp_resume(gc, domid)) return ERROR_FAIL; break; + case LIBXL_DEVICE_MODEL_VERSION_NONE: + break; default: return ERROR_INVAL; } @@ -461,14 +463,10 @@ int libxl__domain_resume(libxl__gc *gc, uint32_t domi= d, int suspend_cancel) goto out; } =20 - if (type =3D=3D LIBXL_DOMAIN_TYPE_HVM || - libxl__device_model_version_running(gc, domid) =3D=3D - LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { - rc =3D libxl__domain_resume_device_model(gc, domid); - if (rc) { - LOGD(ERROR, domid, "failed to resume device model:%d", rc); - goto out; - } + rc =3D libxl__domain_resume_device_model(gc, domid); + if (rc) { + LOGD(ERROR, domid, "failed to resume device model:%d", rc); + goto out; } =20 if (xc_domain_resume(CTX->xch, domid, suspend_cancel)) { While it is easy for the resume path, doing the same in the suspend path needs more changes. libxl__domain_suspend_device_model would need to receive the callback and set it if a device model is active. Should this be done on top of this change? Olaf --Sig_/8_sG1PWKO5Z3DkANiIxesBR Content-Type: application/pgp-signature Content-Description: Digitale Signatur von OpenPGP -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSkRyP6Rn//f03pRUBdQqD6ppg2fgUCXNp4/AAKCRBdQqD6ppg2 fuF0AJ45yZ0+FmU4ej3jZBqXIeadW51Q1QCgm9BbTkX9BDcF1hjKCBRDtvz7+mw= =0uEf -----END PGP SIGNATURE----- --Sig_/8_sG1PWKO5Z3DkANiIxesBR-- --===============0975701872615336832== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmcKaHR0cHM6Ly9saXN0 cy54ZW5wcm9qZWN0Lm9yZy9tYWlsbWFuL2xpc3RpbmZvL3hlbi1kZXZlbA== --===============0975701872615336832==--