xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mini-os: shutdown_thread depends on xenbus
@ 2012-11-30 20:44 Daniel De Graaf
  2012-11-30 23:13 ` Samuel Thibault
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel De Graaf @ 2012-11-30 20:44 UTC (permalink / raw)
  To: samuel.thibault, keir; +Cc: Daniel De Graaf, xen-devel

This fixes the build of the xenstore stub domain, which should never be
shut down and so does not need this feature.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/kernel.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/extras/mini-os/kernel.c b/extras/mini-os/kernel.c
index 378ce12..f2f70f6 100644
--- a/extras/mini-os/kernel.c
+++ b/extras/mini-os/kernel.c
@@ -68,6 +68,7 @@ void setup_xen_features(void)
     }
 }
 
+#ifdef CONFIG_XENBUS
 static void shutdown_thread(void *p)
 {
     const char *path = "control/shutdown";
@@ -96,6 +97,7 @@ static void shutdown_thread(void *p)
     wmb();
     wake_up(&shutdown_queue);
 }
+#endif
 
 
 /* This should be overridden by the application we are linked against. */
@@ -160,7 +162,9 @@ void start_kernel(start_info_t *si)
     /* Init XenBus */
     init_xenbus();
 
+#ifdef CONFIG_XENBUS
     create_thread("shutdown", shutdown_thread, NULL);
+#endif
 
     /* Call (possibly overridden) app_main() */
     app_main(&start_info);
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mini-os: shutdown_thread depends on xenbus
  2012-11-30 20:44 [PATCH] mini-os: shutdown_thread depends on xenbus Daniel De Graaf
@ 2012-11-30 23:13 ` Samuel Thibault
  2012-12-01  7:51   ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: Samuel Thibault @ 2012-11-30 23:13 UTC (permalink / raw)
  To: Daniel De Graaf; +Cc: keir, xen-devel

Daniel De Graaf, le Fri 30 Nov 2012 15:44:49 -0500, a écrit :
> This fixes the build of the xenstore stub domain, which should never be
> shut down and so does not need this feature.

Oops, indeed.
We should probably also comment out the wait queue and variables, to
make sure no code references it?

Samuel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mini-os: shutdown_thread depends on xenbus
  2012-11-30 23:13 ` Samuel Thibault
@ 2012-12-01  7:51   ` Keir Fraser
  2012-12-04  0:27     ` [PATCH] mini-os: drop shutdown variables when CONFIG_XENBUS=n Samuel Thibault
  0 siblings, 1 reply; 4+ messages in thread
From: Keir Fraser @ 2012-12-01  7:51 UTC (permalink / raw)
  To: Samuel Thibault, Daniel De Graaf; +Cc: xen-devel

On 30/11/2012 23:13, "Samuel Thibault" <samuel.thibault@ens-lyon.org> wrote:

> Daniel De Graaf, le Fri 30 Nov 2012 15:44:49 -0500, a écrit :
>> This fixes the build of the xenstore stub domain, which should never be
>> shut down and so does not need this feature.
> 
> Oops, indeed.
> We should probably also comment out the wait queue and variables, to
> make sure no code references it?

I applied Daniel's patch to fix the build. Feel free to follow up with
further cleanup, of course.

 -- Keir

> Samuel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] mini-os: drop shutdown variables when CONFIG_XENBUS=n
  2012-12-01  7:51   ` Keir Fraser
@ 2012-12-04  0:27     ` Samuel Thibault
  0 siblings, 0 replies; 4+ messages in thread
From: Samuel Thibault @ 2012-12-04  0:27 UTC (permalink / raw)
  To: Keir Fraser; +Cc: Daniel De Graaf, xen-devel

Shutdown variables are meaningless when CONFIG_XENBUS=n since no
shutdown event will ever happen.  Better make sure that no code tries to
use it and never get the hoped shutdown event.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

diff -r 29247e44df47 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c	Fri Nov 30 21:51:17 2012 +0000
+++ b/extras/mini-os/kernel.c	Tue Dec 04 01:24:51 2012 +0100
@@ -48,9 +48,11 @@
 
 uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32];
 
+#ifdef CONFIG_XENBUS
 unsigned int do_shutdown = 0;
 unsigned int shutdown_reason;
 DECLARE_WAIT_QUEUE_HEAD(shutdown_queue);
+#endif
 
 void setup_xen_features(void)
 {

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-04  0:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-30 20:44 [PATCH] mini-os: shutdown_thread depends on xenbus Daniel De Graaf
2012-11-30 23:13 ` Samuel Thibault
2012-12-01  7:51   ` Keir Fraser
2012-12-04  0:27     ` [PATCH] mini-os: drop shutdown variables when CONFIG_XENBUS=n Samuel Thibault

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).