All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Durrant <paul.durrant@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Julien Grall <julien.grall@arm.com>,
	Paul Durrant <paul.durrant@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 1/6] domain: stash xen_domctl_createdomain flags in struct domain
Date: Tue, 23 Jul 2019 17:06:04 +0100	[thread overview]
Message-ID: <20190723160609.2177-2-paul.durrant@citrix.com> (raw)
In-Reply-To: <20190723160609.2177-1-paul.durrant@citrix.com>

These are canonical source of data used to set various other flags. If
they are available directly in struct domain then the other flags are no
longer needed.

This patch simply copies the flags into a new 'createflags' field in
struct domain. Subsequent patches will do the related clean-up work.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Julien Grall <julien.grall@arm.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wl@xen.org>
---
 xen/common/domain.c     | 6 ++++--
 xen/include/xen/sched.h | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 55aa759b75..d559c8898e 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -333,6 +333,8 @@ struct domain *domain_create(domid_t domid,
     if ( (d = alloc_domain_struct()) == NULL )
         return ERR_PTR(-ENOMEM);
 
+    d->createflags = config ? config->flags : 0;
+
     /* Sort out our idea of is_system_domain(). */
     d->domain_id = domid;
 
@@ -354,7 +356,7 @@ struct domain *domain_create(domid_t domid,
     }
 
     /* Sort out our idea of is_{pv,hvm}_domain().  All system domains are PV. */
-    d->guest_type = ((config && (config->flags & XEN_DOMCTL_CDF_hvm_guest))
+    d->guest_type = ((d->createflags & XEN_DOMCTL_CDF_hvm_guest)
                      ? guest_type_hvm : guest_type_pv);
 
     TRACE_1D(TRC_DOM0_DOM_ADD, d->domain_id);
@@ -431,7 +433,7 @@ struct domain *domain_create(domid_t domid,
         watchdog_domain_init(d);
         init_status |= INIT_watchdog;
 
-        if ( config->flags & XEN_DOMCTL_CDF_xs_domain )
+        if ( d->createflags & XEN_DOMCTL_CDF_xs_domain )
         {
             d->is_xenstore = 1;
             d->disable_migrate = 1;
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index b40c8fd138..edae372c2b 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -308,6 +308,7 @@ enum guest_type {
 
 struct domain
 {
+    unsigned int     createflags;
     domid_t          domain_id;
 
     unsigned int     max_vcpus;
-- 
2.20.1.2.gb21ebb671


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-07-23 16:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 16:06 [Xen-devel] [PATCH 0/6] stash domain create flags and then use them Paul Durrant
2019-07-23 16:06 ` Paul Durrant [this message]
2019-07-25  9:22   ` [Xen-devel] [PATCH 1/6] domain: stash xen_domctl_createdomain flags in struct domain Roger Pau Monné
2019-07-25 10:11     ` Paul Durrant
2019-07-25 10:24       ` Jan Beulich
2019-07-25 11:24         ` Paul Durrant
2019-07-23 16:06 ` [Xen-devel] [PATCH 2/6] domain: remove 'guest_type' field (and enum guest_type) Paul Durrant
2019-07-25  9:30   ` Roger Pau Monné
2019-07-23 16:06 ` [Xen-devel] [PATCH 3/6] x86/hvm/domain: remove the 'hap_enabled' flag Paul Durrant
2019-07-25  9:44   ` Roger Pau Monné
2019-07-25 10:07     ` Paul Durrant
2019-07-25 12:48       ` Paul Durrant
2019-07-23 16:06 ` [Xen-devel] [PATCH 4/6] x86/domain: remove the 'oos_off' flag Paul Durrant
2019-07-24 17:44   ` Tim Deegan
2019-07-25 10:16     ` Paul Durrant
2019-07-23 16:06 ` [Xen-devel] [PATCH 5/6] domain: remove the 'is_xenstore' flag Paul Durrant
2019-07-25  9:47   ` Roger Pau Monné
2019-07-25 10:08     ` Paul Durrant
2019-07-23 16:06 ` [Xen-devel] [PATCH 6/6] x86/domain: remove the 's3_integrity' flag Paul Durrant
2019-07-25  9:48   ` Roger Pau Monné

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=20190723160609.2177-2-paul.durrant@citrix.com \
    --to=paul.durrant@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wl@xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.