From patchwork Fri Oct 6 13:51:59 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: 9989521 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 1171760247 for ; Fri, 6 Oct 2017 13:54:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0BDF28B12 for ; Fri, 6 Oct 2017 13:54:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2C2B28B9D; Fri, 6 Oct 2017 13:54:57 +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 6759C28B12 for ; Fri, 6 Oct 2017 13:54:57 +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 1e0T3l-0000q1-Bs; Fri, 06 Oct 2017 13:53:01 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0T3k-0000pY-6D for xen-devel@lists.xenproject.org; Fri, 06 Oct 2017 13:53:00 +0000 Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id E4/48-02214-ABA87D95; Fri, 06 Oct 2017 13:52:58 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsXitHRDpO6uruu RBg1TmCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozzlx4xFnRyVSzt38jewNjG0cXIySEh4C8x 8/g0JhCbTUBH4uLcnWxdjBwcIgIqErf3GoCEmQWKJb6u6mMFsYUFkiW2tT9gASlhASr5d9YFJ MwrYCmx+f8zRpCwhICexI/thiBhTgEriYXPp7GB2EJAJadPfmKFKBeUODnzCQvEdE2J1u2/2S FseYnmrbOZIeoVJfrnPWCbwMg3C0nLLCQts5C0LGBkXsWoXpxaVJZapGuql1SUmZ5RkpuYmaN raGCql5taXJyYnpqTmFSsl5yfu4kRGGQMQLCD8Uu/8yFGSQ4mJVHe4sbrkUJ8SfkplRmJxRnx RaU5qcWHGGU4OJQkeN93AuUEi1LTUyvSMnOA4Q6TluDgURLhvQOS5i0uSMwtzkyHSJ1i1OXou Hn3D5MQS15+XqqUOO9lkCIBkKKM0jy4EbDYu8QoKyXMywh0lBBPQWpRbmYJqvwrRnEORiVh3g cgU3gy80rgNr0COoIJ6Ig5TVdAjihJREhJNTD2+Ahqfk/4LSm10sVn8maLqvuvVv7rirNlfhl stHXmpc25VX7JYsuTVxalHfrzx/lo6wmHb7JR7s0Fq/OCxeftzX+aknymrf3M+v51jR6rORPv 1catexhTmLzCdVJ1XovtsTrVtOsus67+7Zgc+fM5x1aBAsPXvjMaA55HvW85OtFfNkf4v7USS 3FGoqEWc1FxIgAObJ2nuAIAAA== X-Env-Sender: prvs=445c74844=roger.pau@citrix.com X-Msg-Ref: server-12.tower-206.messagelabs.com!1507297975!69540360!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 54220 invoked from network); 6 Oct 2017 13:52:57 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 6 Oct 2017 13:52:57 -0000 X-IronPort-AV: E=Sophos;i="5.42,483,1500940800"; d="scan'208";a="442775468" From: Roger Pau Monne To: Date: Fri, 6 Oct 2017 14:51:59 +0100 Message-ID: <20171006135201.97534-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.13.5 (Apple Git-94) In-Reply-To: <20171006135201.97534-1-roger.pau@citrix.com> References: <20171006135201.97534-1-roger.pau@citrix.com> MIME-Version: 1.0 Cc: Wei Liu , Ian Jackson , Roger Pau Monne Subject: [Xen-devel] [PATCH for-4.10 1/3] libxc: panic when trying to create a PVH guest without kernel support 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 Previously when trying to boot a PV capable but not PVH capable kernel inside of a PVH container xc_dom_guest_type would succeed and return a PV guest type, which would lead to failures later on in the build process. Instead provide a clear error message when trying to create a PVH guest using a kernel that doesn't support PVH. Signed-off-by: Roger Pau Monné Acked-by: Ian Jackson --- Cc: Ian Jackson Cc: Wei Liu --- tools/libxc/xc_dom_elfloader.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c index 62d421a5e3..568d7f370c 100644 --- a/tools/libxc/xc_dom_elfloader.c +++ b/tools/libxc/xc_dom_elfloader.c @@ -59,6 +59,13 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom, if ( dom->container_type == XC_DOM_HVM_CONTAINER && dom->parms.phys_entry != UNSET_ADDR32 ) return "hvm-3.0-x86_32"; + if ( dom->container_type == XC_DOM_HVM_CONTAINER ) + { + xc_dom_panic(dom->xch, XC_INVALID_KERNEL, + "%s: image not capable of booting inside a HVM container", + __FUNCTION__); + return "xen-3.0-unknown"; + } switch ( machine ) {