From patchwork Sun Jul 10 11:47:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Condrea X-Patchwork-Id: 9222607 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 347A560572 for ; Sun, 10 Jul 2016 12:07:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2680F24B5B for ; Sun, 10 Jul 2016 12:07:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B5EE2705B; Sun, 10 Jul 2016 12:07:34 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8F2BA24B5B for ; Sun, 10 Jul 2016 12:07:33 +0000 (UTC) Received: from localhost ([::1]:54368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMDWG-0002Rh-An for patchwork-qemu-devel@patchwork.kernel.org; Sun, 10 Jul 2016 08:07:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMDDv-0006Du-9f for qemu-devel@nongnu.org; Sun, 10 Jul 2016 07:48:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMDDs-0001jz-Uw for qemu-devel@nongnu.org; Sun, 10 Jul 2016 07:48:35 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:35987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMDDs-0001jt-OA for qemu-devel@nongnu.org; Sun, 10 Jul 2016 07:48:32 -0400 Received: by mail-wm0-x243.google.com with SMTP id x83so11999456wma.3 for ; Sun, 10 Jul 2016 04:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8SAjLlzMA5hI+wntlj4ojiNR15q+7TT7dgX9lDMVdMQ=; b=F7pkd8xov/AmZPi2vZGkSJntJ0Tr0xasfN7p8HryaXE/pHblujD5gekmxN/xl91zHG cYO//3t9PMywgP1F0MNzT8IWjEo2mlIPrx4hs9sSdgn6uzj8dmsECfYs8QWBWohmcasl bupEKI447xyc6i0f3+4p+isrY18W9kBHIEL5oodIAAQSYqfhrUIBDN/s5yDSNL2EO4Ev WZimk9wXK/gxbq1YcATHt2PFHliCKRpzbuh0ceKBaweETlkcEBqbP+my98zDQrqH0E0x gz8J7a2gPy962PeTge0M1P0UhlGZv+00VxmhMk4N71on9Bvu7r0rMjIPfdqiPsmyiJG6 sWFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8SAjLlzMA5hI+wntlj4ojiNR15q+7TT7dgX9lDMVdMQ=; b=il5HxGqbKO3UiMqrYtwuLaZGu3MyLRsuB12Lofhhz46Iaq7p4RMmw3h70yLidB+dzd RbNGxfgIhUnjth3c4fM/RzLH01nZeOiNIDp3cRT8MIstbn+gB+MSvFW75KqIzj8iZJn1 Q2z01eaxtKbYG61am51Jq6goYOmEYFTBWnuAJXgPLQa982BpY2F9lK7Pez+Dz3bbl0b5 bPoWfSr3G4JlbAvneFVyK3jtYlU/46AVheMTa74GaCMaFw9w8oAFSi9+9w2pL/UY6Y+w Ou1j3bZAd+NQ/CVVK0JY3q/y0ru8ciMEM4yOOGoQT9ETg1Khm1GVYLSwWntmGFOLjCDZ Lszw== X-Gm-Message-State: ALyK8tIlB6ydFyC+QS1+xtK7/XP6gT0kOB5q+Ll6Q4BAUo0nMTltvdQChuSLVW2MTrf8jQ== X-Received: by 10.28.154.214 with SMTP id c205mr7302107wme.9.1468151312148; Sun, 10 Jul 2016 04:48:32 -0700 (PDT) Received: from localhost.localdomain ([79.112.8.37]) by smtp.gmail.com with ESMTPSA id d137sm6888378wmd.12.2016.07.10.04.48.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 10 Jul 2016 04:48:31 -0700 (PDT) From: Emil Condrea To: qemu-devel@nongnu.org Date: Sun, 10 Jul 2016 14:47:44 +0300 Message-Id: <1468151270-12984-14-git-send-email-emilcondrea@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468151270-12984-1-git-send-email-emilcondrea@gmail.com> References: <1468151270-12984-1-git-send-email-emilcondrea@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH 13/19] xen: Distinguish between frontend and backend devops 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: wei.liu2@citrix.com, stefanb@linux.vnet.ibm.com, stefano.stabellini@eu.citrix.com, xen-devel@lists.xen.org, quan.xu@intel.com, dgdegra@tycho.nsa.gov, emilcondrea@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP xen_be_check_state should not be called for frontends Use DEVOPS_FLAG_FE flag to distinguish a frontend. Signed-off-by: Emil Condrea Signed-off-by: Quan Xu --- Changes in v9: * Removed not needed strstr from xenstore_update_be It was left over from first patch series when domu was included in xenstore schema: "%s/backend/%s/%d/%d" --- hw/xen/xen_backend.c | 4 +++- include/hw/xen/xen_pvdev.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index d0e3f50..3931128 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -488,7 +488,9 @@ void xenstore_update_be(char *watch, char *type, int dom, } else { free(bepath); xen_be_backend_changed(xendev, path); - xen_be_check_state(xendev); + if (!(ops->flags & DEVOPS_FLAG_FE)) { + xen_be_check_state(xendev); + } } } } diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index c19e1df..c985a9d 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -14,6 +14,8 @@ struct XenDevice; #define DEVOPS_FLAG_NEED_GNTDEV 1 /* don't expect frontend doing correct state transitions (aka console quirk) */ #define DEVOPS_FLAG_IGNORE_STATE 2 +/*dev is frontend device*/ +#define DEVOPS_FLAG_FE 4 struct XenDevOps { size_t size;