From patchwork Mon Mar 11 18:02:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Andryuk X-Patchwork-Id: 10847975 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DA65C6C2 for ; Mon, 11 Mar 2019 18:13:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C82EE29221 for ; Mon, 11 Mar 2019 18:13:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC0A72922D; Mon, 11 Mar 2019 18:13:10 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6C14D2901B for ; Mon, 11 Mar 2019 18:13:10 +0000 (UTC) Received: from localhost ([127.0.0.1]:38084 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3PQD-0001eL-KR for patchwork-qemu-devel@patchwork.kernel.org; Mon, 11 Mar 2019 14:13:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3PH6-00037x-5I for qemu-devel@nongnu.org; Mon, 11 Mar 2019 14:03:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3PH1-0002e5-5u for qemu-devel@nongnu.org; Mon, 11 Mar 2019 14:03:42 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:42652) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3PGy-0002Oc-GN for qemu-devel@nongnu.org; Mon, 11 Mar 2019 14:03:37 -0400 Received: by mail-qt1-x843.google.com with SMTP id u7so6109064qtg.9 for ; Mon, 11 Mar 2019 11:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zcglz1eNxE2q7OWiP9FjJNKkviuZSiRm7EMY+ZmdRmw=; b=sl0TsJ5569h7iMxH7Oec97j8DcO6DaOnOQY5wQ/GHuflUmVBB800b0rk8xw16vZhO6 k+ov6WjMTq71viKTILfF48eZkhY6nv87nd8YXeNPgmK9vkuSoNSf1Wv17iI9YlCpbFWJ YTaPafUu4091/TMhZdMvUWq74Sz9eHysxIZSMfmbhNdadbXSoEzDV8IjcP0mjHuC75PZ hfSJRoncWaeXQn30RoSLKCJ4xfrJbW7Xg9kpj+tWVktgeW5uc0L0pm1YsB/CHbuumUwq PxoOV3vPhBidhbPLSQ1Vf8Uegb1F10hPsYvEDWyTGqGCCroOOQkyVPVUI6gxvfAoRNMF d/Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zcglz1eNxE2q7OWiP9FjJNKkviuZSiRm7EMY+ZmdRmw=; b=YDKYHaSw4QwDeLJn9EttRBb4SWIx8vh1iZl89KSR+Onzn1u12wtz26rprLMcy8RpFg 0ZRK1m2CvgErrfjG3w1hiaLw/xcqwmD99mbpf6Nxhcq30oN7tCzLUg6YyXmtU3CVp4/t iC2zIYD3TmlRE7KQNBOYXsiSrIFxhC4IThlGcfes0K34hiwOd6BgAX5/klSYiMU1/OBA 9HdIB6f7iGL/i5GdkBeVuSzJ/PykYecWcv9nZJ/56LnaZ5tVlK9DqFU+rH9hXNqsw2GP /2q2pxnJLb7CSnE/Ef8tt25RZtwJ9h5ICi8UiCTJt03L/Fw2YelkPt241yUSn4zgVeTT bsig== X-Gm-Message-State: APjAAAUFewyct99PDL4QPw2GVD60BXpKI6IpQ57Sv1c0bsuwXyJm5q/K 1LbRvKSlPC6ESbHFxjaPWbrjCXdT/bI= X-Google-Smtp-Source: APXvYqxkC50vIl8odwljXBngFsqQe8eDJncRXBUFGzEKwlLGQSGSbiXNBnMxjIdb6xTVul96sBgdSg== X-Received: by 2002:ac8:2ad9:: with SMTP id c25mr26385794qta.250.1552327401631; Mon, 11 Mar 2019 11:03:21 -0700 (PDT) Received: from pm2-ws13.praxislan02.com ([2001:470:8:67e:ba27:ebff:fee8:ce27]) by smtp.gmail.com with ESMTPSA id f126sm4687637qka.14.2019.03.11.11.03.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Mar 2019 11:03:20 -0700 (PDT) From: Jason Andryuk To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 14:02:13 -0400 Message-Id: <20190311180216.18811-4-jandryuk@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311180216.18811-1-jandryuk@gmail.com> References: <20190311180216.18811-1-jandryuk@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 Subject: [Qemu-devel] [PATCH 3/6] xen: Skip backend initialization for stubdom X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Eduardo Habkost , Jason Andryuk , "Michael S. Tsirkin" , marmarek@invisiblethingslab.com, Paul Durrant , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org, Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP When QEMU is running in a stubdom, it does not provide any Paravirtualized backends. Those still run in dom0 or another driver domain. Therefore we skip backend initialization (xen_bus_init and xen_be_init) for the stubdom case. Original patch by Anthony PERARD Signed-off-by: Jason Andryuk Reviewed-by: Paul Durrant --- hw/i386/xen/xen-hvm.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index c20c4b27f6..4b62f070cb 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -1485,8 +1485,6 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) QLIST_INIT(&state->dev_list); device_listener_register(&state->device_listener); - xen_bus_init(); - xenstore = xs_open(0); if (!xenstore) { error_report("Can't connect to xenstored"); @@ -1495,12 +1493,16 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) qemu_set_fd_handler(xs_fileno(xenstore), xenstore_update, NULL, NULL); - /* Initialize backend core & drivers */ - if (xen_be_init() != 0) { - error_report("xen backend core setup failed"); - goto err; + if (!xen_stubdom_enabled()) { + xen_bus_init(); + + /* Initialize backend core & drivers */ + if (xen_be_init() != 0) { + error_report("xen backend core setup failed"); + goto err; + } + xen_be_register_common(); } - xen_be_register_common(); QLIST_INIT(&xen_physmap); xen_read_physmap(state);