Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752124AbdFNPBg (ORCPT ); Wed, 14 Jun 2017 11:01:36 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:42709 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbdFNPBf (ORCPT ); Wed, 14 Jun 2017 11:01:35 -0400 Subject: Re: [PATCH v3 2/4] xen: add sysfs node for guest type To: Juergen Gross , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org References: <20170612142150.15283-1-jgross@suse.com> <20170612142150.15283-3-jgross@suse.com> <89f9f367-3c8d-adf9-1a8e-9ad87da95ea7@oracle.com> Cc: gregkh@linuxfoundation.org From: Boris Ostrovsky Message-ID: Date: Wed, 14 Jun 2017 11:01:17 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 819 Lines: 22 On 06/14/2017 11:00 AM, Juergen Gross wrote: > On 14/06/17 16:48, Boris Ostrovsky wrote: >>> diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c >>> index 84106f9c456c..d641e9970d5d 100644 >>> --- a/drivers/xen/sys-hypervisor.c >>> +++ b/drivers/xen/sys-hypervisor.c >>> @@ -50,6 +50,18 @@ static int __init xen_sysfs_type_init(void) >>> return sysfs_create_file(hypervisor_kobj, &type_attr.attr); >>> } >>> >>> +static ssize_t guest_type_show(struct hyp_sysfs_attr *attr, char *buffer) >>> +{ >>> + return sprintf(buffer, "%s\n", xen_guest_type); >>> +} >> >> So I know I gave my R-b for this patch but can't we just key off >> xen_domain_type and not have xen_guest_type at all? > So we'd need to introduce XEN_PVH_DOMAIN and adjust xen_hvm_domain(). Can't we use xen_pvh_domain()? -boris