* PATCH: Fix PVFB device initialization
@ 2007-10-26 16:12 Daniel P. Berrange
2007-10-29 15:01 ` Alex Williamson
0 siblings, 1 reply; 2+ messages in thread
From: Daniel P. Berrange @ 2007-10-26 16:12 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 603 bytes --]
The final series of patches I sent out lost 2 hunks in the big refactoring
patches I did thanks to a messed up rebase/rediff :-( The attached patch
fixes the device nodename initialization so that watches work correctly.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
[-- Attachment #2: xen-pvfb-nodename.patch --]
[-- Type: text/plain, Size: 2059 bytes --]
diff -r a1da8e458838 tools/ioemu/hw/xenfb.c
--- a/tools/ioemu/hw/xenfb.c Wed Oct 24 16:07:10 2007 -0400
+++ b/tools/ioemu/hw/xenfb.c Fri Oct 26 11:58:09 2007 -0400
@@ -180,6 +180,51 @@ static void xenfb_device_init(struct xen
dev->xenfb = xenfb;
}
+static char *xenfb_path_in_dom(struct xs_handle *xsh,
+ char *buf, size_t size,
+ unsigned domid, const char *fmt, ...)
+{
+ va_list ap;
+ char *domp = xs_get_domain_path(xsh, domid);
+ int n;
+
+ if (domp == NULL)
+ return NULL;
+
+ n = snprintf(buf, size, "%s/", domp);
+ free(domp);
+ if (n >= size)
+ return NULL;
+
+ va_start(ap, fmt);
+ n += vsnprintf(buf + n, size - n, fmt, ap);
+ va_end(ap);
+ if (n >= size)
+ return NULL;
+
+ return buf;
+}
+
+static int xenfb_device_set_domain(struct xenfb_device *dev, int domid)
+{
+ dev->otherend_id = domid;
+
+ if (!xenfb_path_in_dom(dev->xenfb->xsh,
+ dev->otherend, sizeof(dev->otherend),
+ domid, "device/%s/0", dev->devicetype)) {
+ errno = ENOENT;
+ return -1;
+ }
+ if (!xenfb_path_in_dom(dev->xenfb->xsh,
+ dev->nodename, sizeof(dev->nodename),
+ 0, "backend/%s/%d/0", dev->devicetype, domid)) {
+ errno = ENOENT;
+ return -1;
+ }
+
+ return 0;
+}
+
struct xenfb *xenfb_new(int domid, DisplayState *ds)
{
struct xenfb *xenfb = qemu_malloc(sizeof(struct xenfb));
@@ -212,6 +257,10 @@ struct xenfb *xenfb_new(int domid, Displ
xenfb->xsh = xs_daemon_open();
if (!xenfb->xsh)
goto fail;
+
+ xenfb->ds = ds;
+ xenfb_device_set_domain(&xenfb->fb, domid);
+ xenfb_device_set_domain(&xenfb->kbd, domid);
fprintf(stderr, "FB: Waiting for KBD backend creation\n");
xenfb_wait_for_backend(&xenfb->kbd, xenfb_backend_created_kbd);
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: PATCH: Fix PVFB device initialization
2007-10-26 16:12 PATCH: Fix PVFB device initialization Daniel P. Berrange
@ 2007-10-29 15:01 ` Alex Williamson
0 siblings, 0 replies; 2+ messages in thread
From: Alex Williamson @ 2007-10-29 15:01 UTC (permalink / raw)
To: Daniel P. Berrange; +Cc: xen-devel
On Fri, 2007-10-26 at 17:12 +0100, Daniel P. Berrange wrote:
> The final series of patches I sent out lost 2 hunks in the big refactoring
> patches I did thanks to a messed up rebase/rediff :-( The attached patch
> fixes the device nodename initialization so that watches work correctly.
Thanks Dan, this seems to solve the regression I was seeing on ia64.
Alex
--
Alex Williamson HP Open Source & Linux Org.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-10-29 15:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-26 16:12 PATCH: Fix PVFB device initialization Daniel P. Berrange
2007-10-29 15:01 ` Alex Williamson
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.