All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: Gerd Hoffmann <kraxel@redhat.com>,
	Xen Development Mailing List <xen-devel@lists.xensource.com>
Subject: [PATCH] xenfb: make restartable [Was: pv-grub doesn't run on rhel5]
Date: Thu, 14 Aug 2008 19:02:51 +0100	[thread overview]
Message-ID: <20080814180251.GD4590@implementation.uk.xensource.com> (raw)
In-Reply-To: <20080814151359.GT4590@implementation.uk.xensource.com>

Samuel Thibault, le Thu 14 Aug 2008 16:14:00 +0100, a écrit :
> > Another pvgrub issue:  Is booting guests with the framebuffer enabled
> > supposed to work?
> 
> Yes, but you have to not enable the framebuffer in the grub
> configuration, because the framebuffer is currently not able to restart.

Oh actually it was a lot easier than I thought, see patch below (which
is actually partly bug fixes).



xenfb: make restartable

- Fix the pixel unmapping, which should happen during the Closing state.
- Fix qemu segfault when a guest shuts its fb down.
- Once connected, if frontend state goes from Closed to Initialized,
restart the connection loop.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>

diff -r 38783464a671 extras/mini-os/fbfront.c
--- a/extras/mini-os/fbfront.c	Thu Aug 14 16:16:44 2008 +0100
+++ b/extras/mini-os/fbfront.c	Thu Aug 14 18:59:27 2008 +0100
@@ -226,8 +226,7 @@ void shutdown_kbdfront(struct kbdfront_d
     xenbus_wait_for_value(path, "6", &dev->events);
 
     err = xenbus_printf(XBT_NIL, nodename, "state", "%u", 1);
-    // does not work yet.
-    //xenbus_wait_for_value(path, "2", &dev->events);
+    xenbus_wait_for_value(path, "2", &dev->events);
 
     xenbus_unwatch_path(XBT_NIL, path);
 
@@ -566,8 +565,7 @@ void shutdown_fbfront(struct fbfront_dev
     xenbus_wait_for_value(path, "6", &dev->events);
 
     err = xenbus_printf(XBT_NIL, nodename, "state", "%u", 1);
-    // does not work yet
-    //xenbus_wait_for_value(path, "2", &dev->events);
+    xenbus_wait_for_value(path, "2", &dev->events);
 
     xenbus_unwatch_path(XBT_NIL, path);
 
diff -r 38783464a671 stubdom/README
--- a/stubdom/README	Thu Aug 14 16:16:44 2008 +0100
+++ b/stubdom/README	Thu Aug 14 18:59:27 2008 +0100
@@ -126,9 +126,4 @@ Limitations
 ===========
 
 - You can not boot a 64bit kernel with a 32bit-compiled PV-GRUB and vice-versa.
-To cross-compile a 32bit PV-GRUB,
-
-export XEN_TARGET_ARCH=x86_32
-
-- bootsplash is supported, but the ioemu backend does not yet support restart
-for use by the booted kernel.
+You need to choose between pv-grub-x86_64.gz and pv-grub-x86_32.gz
diff -r 38783464a671 tools/ioemu/hw/xenfb.c
--- a/tools/ioemu/hw/xenfb.c	Thu Aug 14 16:16:44 2008 +0100
+++ b/tools/ioemu/hw/xenfb.c	Thu Aug 14 18:59:27 2008 +0100
@@ -445,6 +445,13 @@ static void xenfb_unbind(struct xenfb_de
 		xc_evtchn_unbind(dev->xenfb->evt_xch, dev->port);
 		dev->port = -1;
 	}
+
+	if (!strcmp(dev->devicetype, "vfb")) {
+	    if (dev->xenfb->pixels) {
+		    munmap(dev->xenfb->pixels, dev->xenfb->fb_len);
+		    dev->xenfb->pixels = NULL;
+	    }
+	}
 }
 
 
@@ -452,10 +459,6 @@ static void xenfb_detach_dom(struct xenf
 {
 	xenfb_unbind(&xenfb->fb);
 	xenfb_unbind(&xenfb->kbd);
-	if (xenfb->pixels) {
-		munmap(xenfb->pixels, xenfb->fb_len);
-		xenfb->pixels = NULL;
-	}
 }
 
 /* Remove the backend area in xenbus since the framebuffer really is
@@ -653,6 +656,16 @@ static int xenfb_on_state_change(struct 
 		   not much point in us continuing. */
 		return -1;
 	case XenbusStateInitialising:
+		if (dev->state != XenbusStateClosed)
+		    /* Do not let a domain make us skip the closing state */
+		    return 0;
+		xenfb_switch_state(dev, XenbusStateInitWait);
+		xs_unwatch(dev->xenfb->xsh, dev->otherend, "");
+		if (!strcmp(dev->devicetype, "vkbd")) {
+		    fprintf(stderr, "FB: Waiting for KBD backend creation\n");
+		    xenfb_wait_for_frontend(&dev->xenfb->kbd, xenfb_frontend_initialized_kbd);
+		}
+		break;
 	case XenbusStateInitWait:
 	case XenbusStateInitialised:
 	case XenbusStateConnected:
@@ -1274,6 +1287,9 @@ static void xenfb_update(void *opaque)
     struct xenfb *xenfb = opaque;
     int period;
 
+    if (!xenfb->fb.page)
+        return;
+
     if (xenfb_queue_full(xenfb))
         return;
 

  parent reply	other threads:[~2008-08-14 18:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-14 10:38 [bug] pv-grub doesn't run on rhel5 Gerd Hoffmann
2008-08-14 11:15 ` Samuel Thibault
     [not found]   ` <48A4232B.6040500@redhat.com>
2008-08-14 12:29     ` Samuel Thibault
2008-08-14 14:18       ` Gerd Hoffmann
2008-08-14 14:28         ` Samuel Thibault
2008-08-14 15:04           ` Gerd Hoffmann
2008-08-14 15:14             ` Samuel Thibault
2008-08-14 15:36               ` Samuel Thibault
2008-08-14 16:01               ` Gerd Hoffmann
2008-08-14 18:02               ` Samuel Thibault [this message]
2008-08-15  7:02                 ` [PATCH] xenfb: make restartable [Was: pv-grub doesn't run on rhel5] Gerd Hoffmann
2008-08-15 12:39                 ` [PATCH] xenfb: make restartable Markus Armbruster
2008-08-15 22:23                   ` Samuel Thibault
2008-08-15 22:53                     ` Markus Armbruster
2008-08-16 22:33                       ` Samuel Thibault
2008-08-14 15:55           ` [bug] pv-grub doesn't run on rhel5 Jeremy Fitzhardinge
2008-08-14 16:04             ` Gerd Hoffmann
2008-08-14 12:33   ` [PATCH] compiled a 32bit pv-grub on x86_64 xen target [Was: pv-grub doesn't run on rhel5] Samuel Thibault

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=20080814180251.GD4590@implementation.uk.xensource.com \
    --to=samuel.thibault@eu.citrix.com \
    --cc=kraxel@redhat.com \
    --cc=xen-devel@lists.xensource.com \
    /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.