Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 291473 Details for
Bug 428231
Switch Xen PVFB over to use QEMU instead of libvncserver & merge TLS patches
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Add compat PVFB support to QEMU
xen-pvfb-compat-qemu.patch (text/plain), 10.24 KB, created by
Daniel Berrangé
on 2008-01-12 19:16:09 UTC
(
hide
)
Description:
Add compat PVFB support to QEMU
Filename:
MIME Type:
Creator:
Daniel Berrangé
Created:
2008-01-12 19:16:09 UTC
Size:
10.24 KB
patch
obsolete
>diff -rupN xen-3.1.0-src.orig/tools/ioemu/Makefile.target xen-3.1.0-src.new/tools/ioemu/Makefile.target >--- xen-3.1.0-src.orig/tools/ioemu/Makefile.target 2008-01-12 13:43:39.000000000 -0500 >+++ xen-3.1.0-src.new/tools/ioemu/Makefile.target 2008-01-12 13:50:00.000000000 -0500 >@@ -376,7 +376,7 @@ VL_OBJS+= xenstore.o > VL_OBJS+= xen_platform.o > VL_OBJS+= xen_machine_fv.o > VL_OBJS+= xen_machine_pv.o >-VL_OBJS+= ../../xenfb/xenfb.o >+VL_OBJS+= ../../xenfb/xenfb.o ../../xenfb/oldxenfb.o > VL_OBJS+= tpm_tis.o > DEFINES += -DHAS_AUDIO > endif >diff -rupN xen-3.1.0-src.orig/tools/xenfb/oldxenfb.c xen-3.1.0-src.new/tools/xenfb/oldxenfb.c >--- xen-3.1.0-src.orig/tools/xenfb/oldxenfb.c 2008-01-12 13:43:38.000000000 -0500 >+++ xen-3.1.0-src.new/tools/xenfb/oldxenfb.c 2008-01-12 14:08:34.000000000 -0500 >@@ -133,86 +133,6 @@ static void xenfb_device_init(struct xen > dev->xenfb = xenfb; > } > >-int xenfb_device_set_domain(struct xenfb_device *dev, int domid) >-{ >- struct xenfb_private *xenfb = dev->xenfb; >- >- dev->otherend_id = domid; >- >- if (!xenfb_path_in_dom(xenfb->xsh, >- dev->otherend, sizeof(dev->otherend), >- domid, "device/%s/0", dev->devicetype)) { >- errno = ENOENT; >- return -1; >- } >- if (!xenfb_path_in_dom(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(void) >-{ >- struct xenfb_private *xenfb = malloc(sizeof(*xenfb)); >- int serrno; >- >- if (xenfb == NULL) >- return NULL; >- >- memset(xenfb, 0, sizeof(*xenfb)); >- xenfb->evt_xch = xenfb->xc = -1; >- xenfb_device_init(&xenfb->fb, "vfb", xenfb); >- xenfb_device_init(&xenfb->kbd, "vkbd", xenfb); >- >- xenfb->evt_xch = xc_evtchn_open(); >- if (xenfb->evt_xch == -1) >- goto fail; >- >- xenfb->xc = xc_interface_open(); >- if (xenfb->xc == -1) >- goto fail; >- >- xenfb->xsh = xs_daemon_open(); >- if (!xenfb->xsh) >- goto fail; >- >- return &xenfb->pub; >- >- fail: >- serrno = errno; >- xenfb_delete(&xenfb->pub); >- errno = serrno; >- return NULL; >-} >- >-/* Remove the backend area in xenbus since the framebuffer really is >- going away. */ >-void xenfb_teardown(struct xenfb *xenfb_pub) >-{ >- struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; >- >- xs_rm(xenfb->xsh, XBT_NULL, xenfb->fb.nodename); >- xs_rm(xenfb->xsh, XBT_NULL, xenfb->kbd.nodename); >-} >- >- >-void xenfb_delete(struct xenfb *xenfb_pub) >-{ >- struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; >- >- xenfb_detach_dom(xenfb); >- if (xenfb->xc >= 0) >- xc_interface_close(xenfb->xc); >- if (xenfb->evt_xch >= 0) >- xc_evtchn_close(xenfb->evt_xch); >- if (xenfb->xsh) >- xs_daemon_close(xenfb->xsh); >- free(xenfb); >-} > > static enum xenbus_state xenfb_read_state(struct xs_handle *xsh, > const char *dir) >@@ -239,11 +159,6 @@ static int xenfb_switch_state(struct xen > return 0; > } > >-int xenfb_switch_to_old_protocol(char **argv) >-{ >- abort(); >-} >- > static void xenfb_copy_mfns(int mode, int count, unsigned long *dst, void *src) > { > uint32_t *src32 = src; >@@ -405,7 +320,7 @@ static void xenfb_dev_fatal(struct xenfb > xenfb_switch_state(dev, XenbusStateClosing); > } > >-int xenfb_attach_dom(struct xenfb *xenfb_pub, int domid) >+int oldxenfb_attach_dom(struct xenfb *xenfb_pub, int domid) > { > struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; > struct xs_handle *xsh = xenfb->xsh; >@@ -578,51 +493,42 @@ static int xenfb_on_state_change(struct > return 0; > } > >-/* Returns 0 normally, -1 on error, or -2 if the domain went away. */ >-int xenfb_poll(struct xenfb *xenfb_pub, fd_set *readfds) >+ >+int oldxenfb_dispatch_channel(struct xenfb *xenfb_pub) > { > struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; > evtchn_port_t port; >- unsigned dummy; >- char **vec; >- int r; >- >- if (FD_ISSET(xc_evtchn_fd(xenfb->evt_xch), readfds)) { >- port = xc_evtchn_pending(xenfb->evt_xch); >- if (port == -1) >- return -1; >- >- if (port == xenfb->fb.port) >- xenfb_on_fb_event(xenfb); >- else if (port == xenfb->kbd.port) >- xenfb_on_kbd_event(xenfb); >+ port = xc_evtchn_pending(xenfb->evt_xch); >+ if (port == -1) >+ return -1; > >- if (xc_evtchn_unmask(xenfb->evt_xch, port) == -1) >- return -1; >- } >+ if (port == xenfb->fb.port) >+ xenfb_on_fb_event(xenfb); >+ else if (port == xenfb->kbd.port) >+ xenfb_on_kbd_event(xenfb); > >- if (FD_ISSET(xs_fileno(xenfb->xsh), readfds)) { >- vec = xs_read_watch(xenfb->xsh, &dummy); >- free(vec); >- r = xenfb_on_state_change(&xenfb->fb); >- if (r == 0) >- r = xenfb_on_state_change(&xenfb->kbd); >- if (r == -1) >- return -2; >- } >+ if (xc_evtchn_unmask(xenfb->evt_xch, port) == -1) >+ return -1; > > return 0; > } > >-int xenfb_select_fds(struct xenfb *xenfb_pub, fd_set *readfds) >+int oldxenfb_dispatch_store(struct xenfb *xenfb_pub) > { > struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; >- int fd1 = xc_evtchn_fd(xenfb->evt_xch); >- int fd2 = xs_fileno(xenfb->xsh); >+ unsigned dummy; >+ char **vec; >+ int r; >+ >+ vec = xs_read_watch(xenfb->xsh, &dummy); >+ free(vec); >+ r = xenfb_on_state_change(&xenfb->fb); >+ if (r == 0) >+ r = xenfb_on_state_change(&xenfb->kbd); >+ if (r == -1) >+ return -2; > >- FD_SET(fd1, readfds); >- FD_SET(fd2, readfds); >- return fd1 > fd2 ? fd1 + 1 : fd2 + 1; >+ return 0; > } > > static int xenfb_fb_event32(struct xenfb_private *xenfb, >@@ -701,7 +607,7 @@ static int xenfb_kbd_event(struct xenfb_ > return xc_evtchn_notify(xenfb->evt_xch, xenfb->kbd.port); > } > >-int xenfb_send_key(struct xenfb *xenfb_pub, bool down, int keycode) >+int oldxenfb_send_key(struct xenfb *xenfb_pub, bool down, int keycode) > { > struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; > union xenkbd_in_event event; >@@ -714,7 +620,7 @@ int xenfb_send_key(struct xenfb *xenfb_p > return xenfb_kbd_event(xenfb, &event); > } > >-int xenfb_send_motion(struct xenfb *xenfb_pub, int rel_x, int rel_y) >+int oldxenfb_send_motion(struct xenfb *xenfb_pub, int rel_x, int rel_y) > { > struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; > union xenkbd_in_event event; >@@ -727,7 +633,3 @@ int xenfb_send_motion(struct xenfb *xenf > return xenfb_kbd_event(xenfb, &event); > } > >-int xenfb_send_position(struct xenfb *xenfb_pub, int abs_x, int abs_y) >-{ >- abort(); >-} >diff -rupN xen-3.1.0-src.orig/tools/xenfb/xenfb.c xen-3.1.0-src.new/tools/xenfb/xenfb.c >--- xen-3.1.0-src.orig/tools/xenfb/xenfb.c 2008-01-12 13:43:39.000000000 -0500 >+++ xen-3.1.0-src.new/tools/xenfb/xenfb.c 2008-01-12 14:05:04.000000000 -0500 >@@ -45,6 +45,7 @@ struct xenfb_private { > struct xenfb_device fb, kbd; > size_t fb_len; /* size of framebuffer */ > char protocol[64]; /* frontend protocol */ >+ int oldprotocol; > }; > > static void xenfb_detach_dom(struct xenfb_private *); >@@ -349,20 +350,6 @@ static int xenfb_using_old_protocol(stru > return ret; > } > >-int xenfb_switch_to_old_protocol(char **argv) >-{ >- size_t len = strlen(argv[0]); >- char *prog; >- >- prog = malloc(len + 2); >- if (!prog) >- return -1; >- strcpy(prog, argv[0]); >- strcpy(prog + len, "o"); >- argv[0] = prog; >- return execv(prog, argv); >-} >- > static int xenfb_wait_for_frontend_initialised(struct xenfb_device *dev) > { > switch (xenfb_wait_for_state(dev->xenfb->xsh, dev->otherend, >@@ -577,7 +564,7 @@ int xenfb_attach_dom(struct xenfb *xenfb > { > struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; > struct xs_handle *xsh = xenfb->xsh; >- int ret, val, serrno; >+ int val, serrno; > struct xenfb_page *fb_page; > > xenfb_detach_dom(xenfb); >@@ -607,9 +594,14 @@ int xenfb_attach_dom(struct xenfb *xenfb > if (!xs_watch(xsh, xenfb->kbd.otherend, "")) > goto error; > >- ret = xenfb_using_old_protocol(xenfb); >- if (ret) >- return ret; >+ /* !!! FC-5/6 guest compatability - not upstream !!! */ >+ if (xenfb_using_old_protocol(xenfb)) { >+ fprintf(stderr, "Switching to old protocol\n"); >+ xenfb->oldprotocol = 1; >+ return oldxenfb_attach_dom(xenfb_pub, domid); >+ } else { >+ fprintf(stderr, "Sticking to new protocol\n"); >+ } > > if (xenfb_wait_for_frontend_initialised(&xenfb->fb) < 0) > goto error; >@@ -761,6 +753,10 @@ int xenfb_dispatch_channel(struct xenfb > { > struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; > evtchn_port_t port; >+ >+ if (xenfb->oldprotocol) >+ return oldxenfb_dispatch_channel(xenfb_pub); >+ > port = xc_evtchn_pending(xenfb->evt_xch); > if (port == -1) > return -1; >@@ -783,6 +779,9 @@ int xenfb_dispatch_store(struct xenfb *x > char **vec; > int r; > >+ if (xenfb->oldprotocol) >+ return oldxenfb_dispatch_store(xenfb_pub); >+ > vec = xs_read_watch(xenfb->xsh, &dummy); > free(vec); > r = xenfb_on_state_change(&xenfb->fb); >@@ -864,6 +863,9 @@ int xenfb_send_key(struct xenfb *xenfb_p > struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; > union xenkbd_in_event event; > >+ if (xenfb->oldprotocol) >+ return oldxenfb_send_key(xenfb_pub, down, keycode); >+ > memset(&event, 0, XENKBD_IN_EVENT_SIZE); > event.type = XENKBD_TYPE_KEY; > event.key.pressed = down ? 1 : 0; >@@ -877,6 +879,9 @@ int xenfb_send_motion(struct xenfb *xenf > struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; > union xenkbd_in_event event; > >+ if (xenfb->oldprotocol) >+ return oldxenfb_send_motion(xenfb_pub, rel_x, rel_y); >+ > memset(&event, 0, XENKBD_IN_EVENT_SIZE); > event.type = XENKBD_TYPE_MOTION; > event.motion.rel_x = rel_x; >@@ -890,6 +895,9 @@ int xenfb_send_position(struct xenfb *xe > struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; > union xenkbd_in_event event; > >+ if (xenfb->oldprotocol) >+ return -1; >+ > memset(&event, 0, XENKBD_IN_EVENT_SIZE); > event.type = XENKBD_TYPE_POS; > event.pos.abs_x = abs_x; >diff -rupN xen-3.1.0-src.orig/tools/xenfb/xenfb.h xen-3.1.0-src.new/tools/xenfb/xenfb.h >--- xen-3.1.0-src.orig/tools/xenfb/xenfb.h 2008-01-12 13:43:39.000000000 -0500 >+++ xen-3.1.0-src.new/tools/xenfb/xenfb.h 2008-01-12 13:58:20.000000000 -0500 >@@ -36,6 +36,13 @@ int xenfb_send_key(struct xenfb *xenfb, > int xenfb_send_motion(struct xenfb *xenfb, int rel_x, int rel_y); > int xenfb_send_position(struct xenfb *xenfb, int abs_x, int abs_y); > >-int xenfb_switch_to_old_protocol(char **); >+/* Pass-through legacy handlers */ >+int oldxenfb_attach_dom(struct xenfb *xenfb, int domid); >+ >+int oldxenfb_dispatch_store(struct xenfb *xenfb_pub); >+int oldxenfb_dispatch_channel(struct xenfb *xenfb_pub); >+ >+int oldxenfb_send_key(struct xenfb *xenfb, bool down, int keycode); >+int oldxenfb_send_motion(struct xenfb *xenfb, int rel_x, int rel_y); > > #endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 428231
:
291430
|
291431
|
291432
|
291433
|
291434
|
291435
| 291473 |
291474