From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Juergen Gross <jgross@suse.com>,
linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Cc: gregkh@linuxfoundation.org
Subject: Re: [PATCH v4 2/4] xen: add sysfs node for guest type
Date: Wed, 14 Jun 2017 13:43:45 -0400 [thread overview]
Message-ID: <f26efdc0-84ec-6aeb-d488-06b580d59325@oracle.com> (raw)
In-Reply-To: <20170614172352.27557-3-jgross@suse.com>
> --- a/Documentation/ABI/testing/sysfs-hypervisor-pmu
> +++ b/Documentation/ABI/testing/sysfs-hypervisor-xen
> @@ -1,8 +1,19 @@
> +What: /sys/hypervisor/guest_type
> +Date: May 2017
> +KernelVersion: 4.13
> +Contact: xen-devel@lists.xenproject.org
> +Description: If running under Xen:
> + Type of guest:
> + "Xen": standard guest type on arm
> + "HVM": fully virtualized guest (x86)
> + "PV": paravirtualized guest (x86)
> + "PVH": fully virtualized guest without legacy emulation (x86)
> +
>
>
> +static ssize_t guest_type_show(struct hyp_sysfs_attr *attr, char *buffer)
> +{
> + const char *type = "???";
> +
> + switch (xen_domain_type) {
> + case XEN_NATIVE:
> + /* ARM only. */
> + type = "Xen";
> + break;
> + case XEN_PV_DOMAIN:
> + type = "PV";
> + break;
> + case XEN_HVM_DOMAIN:
> + type = xen_pvh_domain() ? "PVH" : "HVM";
> + break;
> + }
I think we should return -EINVAL for unknown type. Or document "???" in
the ABI document.
-boris
> + return sprintf(buffer, "%s\n", type);
> +}
>
next prev parent reply other threads:[~2017-06-14 17:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-14 17:23 [PATCH v4 0/4] xen: add xen sysfs nodes Juergen Gross
2017-06-14 17:23 ` [PATCH v4 1/4] doc,xen: document hypervisor sysfs nodes for xen Juergen Gross
2017-06-14 17:23 ` [PATCH v4 2/4] xen: add sysfs node for guest type Juergen Gross
2017-06-14 17:43 ` Boris Ostrovsky [this message]
2017-06-14 18:52 ` Juergen Gross
2017-06-14 18:56 ` Boris Ostrovsky
2017-06-14 17:23 ` [PATCH v4 3/4] xen: sync include/xen/interface/version.h Juergen Gross
2017-06-14 17:23 ` [PATCH v4 4/4] xen: add sysfs node for hypervisor build id Juergen Gross
2017-06-14 17:45 ` Boris Ostrovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f26efdc0-84ec-6aeb-d488-06b580d59325@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®