From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 6/18 V2]: PVH xen: Introduce PVH guest type
Date: Mon, 18 Mar 2013 17:21:22 -0700 [thread overview]
Message-ID: <20130318172122.05a084e3@mantra.us.oracle.com> (raw)
In-Reply-To: <51470E8502000078000C652A@nat28.tlf.novell.com>
On Mon, 18 Mar 2013 11:54:29 +0000
"Jan Beulich" <JBeulich@suse.com> wrote:
> >>> On 16.03.13 at 01:32, Mukesh Rathor <mukesh.rathor@oracle.com>
> >>> wrote:
> > @@ -277,8 +280,8 @@ struct domain
> > struct rangeset *iomem_caps;
> > struct rangeset *irq_caps;
> >
> > - /* Is this an HVM guest? */
> > - bool_t is_hvm;
> > + /* !is_pvh && !is_hvm ==> PV, else PVH or HVM */
> > + enum {hvm_guest=1, pvh_guest} guest_type;
>
> Even if not used explicitly anywhere right now, please make the PV
> guest case explicit here too (at once avoiding the =1).
Ok.
> Quite likely we'll want to also have the enum have a tag, so we
> can eventually pass value from this enumeration to functions.
Ok.
> I'm also mildly puzzled by you using "_guest" suffixes here rather
> than, as usual, a common prefix.
>
> And of course, please properly format this.
Not sure I follow what needs formatting?
> > @@ -718,10 +725,14 @@ void watchdog_domain_destroy(struct domain
> > *d);
> > #define VM_ASSIST(_d,_t) (test_bit((_t), &(_d)->vm_assist))
> >
> > -#define is_hvm_domain(d) ((d)->is_hvm)
> > +#define is_hvm_domain(d) ((d)->guest_type == hvm_guest)
> > #define is_hvm_vcpu(v) (is_hvm_domain(v->domain))
> > +#define is_pvh_domain(d) ((d)->guest_type == pvh_guest)
> > +#define is_pvh_vcpu(v) (is_pvh_domain(v->domain))
> > #define is_pinned_vcpu(v) ((v)->domain->is_pinned || \
> > cpumask_weight((v)->cpu_affinity) == 1)
> > +#define is_hvm_or_pvh_domain(d) (is_hvm_domain(d) ||
> > is_pvh_domain(d)) +#define is_hvm_or_pvh_vcpu(v)
> > (is_hvm_or_pvh_domain(v->domain))
>
> These surely can have better names, if they're needed at all:
> Wouldn't !is_pv_domain() do what you need?
Nop, that's more confusing, since PVH is a PV domain. So, I suggest
we leave it as is. is_hvm_or_pvh_domain is nicely readable, what name
do you suggest?
Thanks,
Mukesh
next prev parent reply other threads:[~2013-03-19 0:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-16 0:32 [PATCH 6/18 V2]: PVH xen: Introduce PVH guest type Mukesh Rathor
2013-03-18 11:54 ` Jan Beulich
2013-03-19 0:21 ` Mukesh Rathor [this message]
2013-03-19 8:48 ` Jan Beulich
2013-03-19 13:03 ` Konrad Rzeszutek Wilk
2013-03-19 13:41 ` Jan Beulich
2013-03-23 1:13 ` Mukesh Rathor
2013-03-25 9:26 ` Jan Beulich
2013-03-25 19:05 ` Mukesh Rathor
2013-03-25 20:07 ` Keir Fraser
2013-03-25 22:04 ` Mukesh Rathor
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=20130318172122.05a084e3@mantra.us.oracle.com \
--to=mukesh.rathor@oracle.com \
--cc=JBeulich@suse.com \
--cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).