diff options
author | cegger <cegger> | 2009-02-20 23:22:47 +0000 |
---|---|---|
committer | cegger <cegger> | 2009-02-20 23:22:47 +0000 |
commit | 1ae19e449925cfa7f63f95f5b81737ffa8be45d4 (patch) | |
tree | a3d0cb7e8eb0a909cb4b2dbce7fe9efa5970330b /sysutils | |
parent | 25737f88ce815d7b00c6386adbde35d1f7029ada (diff) | |
download | pkgsrc-1ae19e449925cfa7f63f95f5b81737ffa8be45d4.tar.gz |
apply fixes from hannken@
- make pygrub in interactive mode working (upstream c/s 18586)
- PR port-xen/40675: make xen guest console visible (upstream c/s 18591)
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/xentools33/Makefile | 4 | ||||
-rw-r--r-- | sysutils/xentools33/distinfo | 4 | ||||
-rw-r--r-- | sysutils/xentools33/patches/patch-ga | 119 | ||||
-rw-r--r-- | sysutils/xentools33/patches/patch-gb | 38 |
4 files changed, 162 insertions, 3 deletions
diff --git a/sysutils/xentools33/Makefile b/sysutils/xentools33/Makefile index cfdd00efb6a..8e300e26be7 100644 --- a/sysutils/xentools33/Makefile +++ b/sysutils/xentools33/Makefile @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.16 2009/02/18 20:31:29 cegger Exp $ +# $NetBSD: Makefile,v 1.17 2009/02/20 23:22:47 cegger Exp $ # VERSION= 3.3.1 DISTNAME= xen-${VERSION} PKGNAME= xentools33-${VERSION} -PKGREVISION= 5 +PKGREVISION= 6 CATEGORIES= sysutils MASTER_SITES= http://bits.xensource.com/oss-xen/release/${VERSION}/ EXTRACT_SUFX= .tar.gz diff --git a/sysutils/xentools33/distinfo b/sysutils/xentools33/distinfo index 89f1b419a52..95e3aa2dafc 100644 --- a/sysutils/xentools33/distinfo +++ b/sysutils/xentools33/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.15 2009/01/13 13:48:32 cegger Exp $ +$NetBSD: distinfo,v 1.16 2009/02/20 23:22:47 cegger Exp $ SHA1 (xen-3.3.1.tar.gz) = fa63c80e04dfc1bb376d98c5a0a0b08f7912b3f9 RMD160 (xen-3.3.1.tar.gz) = 31d3e801b4eec37715900c6247be403aaafdd5e1 @@ -49,3 +49,5 @@ SHA1 (patch-fb) = 22a07628566b43aa786c410927d29a283e8cf141 SHA1 (patch-fc) = 37c9b0897182de93a01f9620ef6346ef68157770 SHA1 (patch-fd) = cb4741bf33050d72cfbcd2eff4a8632d976de643 SHA1 (patch-fe) = 85d42672766fe8ce2dc7f745938722710c6ee5a3 +SHA1 (patch-ga) = 12b32e7af51d49f068e2e6533bec901d9d128e9c +SHA1 (patch-gb) = b4ff4785791112077bfb4160fb88642aa4b2b346 diff --git a/sysutils/xentools33/patches/patch-ga b/sysutils/xentools33/patches/patch-ga new file mode 100644 index 00000000000..7347700fa9b --- /dev/null +++ b/sysutils/xentools33/patches/patch-ga @@ -0,0 +1,119 @@ +$NetBSD: patch-ga,v 1.3 2009/02/20 23:22:47 cegger Exp $ + +--- python/xen/xend/XendBootloader.py.orig 2009-01-05 11:26:59.000000000 +0000 ++++ python/xen/xend/XendBootloader.py +@@ -67,9 +67,23 @@ def bootloader(blexec, disk, dom, quiet + # listening on the bootloader's fifo for the results. + + (m1, s1) = pty.openpty() +- tty.setraw(m1); +- fcntl.fcntl(m1, fcntl.F_SETFL, os.O_NDELAY); +- os.close(s1) ++ ++ # On Solaris, the pty master side will get cranky if we try ++ # to write to it while there is no slave. To work around this, ++ # keep the slave descriptor open until we're done. Set it ++ # to raw terminal parameters, otherwise it will echo back ++ # characters, which will confuse the I/O loop below. ++ # Furthermore, a raw master pty device has no terminal ++ # semantics on Solaris, so don't try to set any attributes ++ # for it. ++ if os.uname()[0] != 'SunOS' and os.uname()[0] != 'NetBSD': ++ tty.setraw(m1) ++ os.close(s1) ++ else: ++ tty.setraw(s1) ++ ++ fcntl.fcntl(m1, fcntl.F_SETFL, os.O_NDELAY) ++ + slavename = ptsname.ptsname(m1) + dom.storeDom("console/tty", slavename) + +@@ -108,7 +122,11 @@ def bootloader(blexec, disk, dom, quiet + # record that this domain is bootloading + dom.bootloader_pid = child + +- tty.setraw(m2); ++ # On Solaris, the master pty side does not have terminal semantics, ++ # so don't try to set any attributes, as it will fail. ++ if os.uname()[0] != 'SunOS': ++ tty.setraw(m2); ++ + fcntl.fcntl(m2, fcntl.F_SETFL, os.O_NDELAY); + while True: + try: +@@ -117,32 +135,55 @@ def bootloader(blexec, disk, dom, quiet + if e.errno == errno.EINTR: + continue + break ++ ++ fcntl.fcntl(r, fcntl.F_SETFL, os.O_NDELAY); ++ + ret = "" + inbuf=""; outbuf=""; ++ # filedescriptors: ++ # r - input from the bootloader (bootstring output) ++ # m1 - input/output from/to xenconsole ++ # m2 - input/output from/to pty that controls the bootloader ++ # The filedescriptors are NDELAY, so it's ok to try to read ++ # bigger chunks than may be available, to keep e.g. curses ++ # screen redraws in the bootloader efficient. m1 is the side that ++ # gets xenconsole input, which will be keystrokes, so a small number ++ # is sufficient. m2 is pygrub output, which will be curses screen ++ # updates, so a larger number (1024) is appropriate there. ++ # ++ # For writeable descriptors, only include them in the set for select ++ # if there is actual data to write, otherwise this would loop too fast, ++ # eating up CPU time. ++ + while True: +- sel = select.select([r, m1, m2], [m1, m2], []) ++ wsel = [] ++ if len(outbuf) != 0: ++ wsel = wsel + [m1] ++ if len(inbuf) != 0: ++ wsel = wsel + [m2] ++ sel = select.select([r, m1, m2], wsel, []) + try: + if m1 in sel[0]: +- s = os.read(m1, 1) ++ s = os.read(m1, 16) + inbuf += s +- if m2 in sel[1] and len(inbuf) != 0: +- os.write(m2, inbuf[0]) +- inbuf = inbuf[1:] ++ if m2 in sel[1]: ++ n = os.write(m2, inbuf) ++ inbuf = inbuf[n:] + except OSError, e: + if e.errno == errno.EIO: + pass + try: + if m2 in sel[0]: +- s = os.read(m2, 1) ++ s = os.read(m2, 1024) + outbuf += s +- if m1 in sel[1] and len(outbuf) != 0: +- os.write(m1, outbuf[0]) +- outbuf = outbuf[1:] ++ if m1 in sel[1]: ++ n = os.write(m1, outbuf) ++ outbuf = outbuf[n:] + except OSError, e: + if e.errno == errno.EIO: + pass + if r in sel[0]: +- s = os.read(r, 1) ++ s = os.read(r, 128) + ret = ret + s + if len(s) == 0: + break +@@ -152,6 +193,8 @@ def bootloader(blexec, disk, dom, quiet + os.close(r) + os.close(m2) + os.close(m1) ++ if os.uname()[0] == 'SunOS' or os.uname()[0] == 'NetBSD': ++ os.close(s1) + os.unlink(fifo) + + # Re-acquire the lock to cover the changes we're about to make diff --git a/sysutils/xentools33/patches/patch-gb b/sysutils/xentools33/patches/patch-gb new file mode 100644 index 00000000000..3128cc8bac5 --- /dev/null +++ b/sysutils/xentools33/patches/patch-gb @@ -0,0 +1,38 @@ +$NetBSD: patch-gb,v 1.3 2009/02/20 23:22:47 cegger Exp $ + +--- console/daemon/io.c.orig 2009-01-05 11:26:58.000000000 +0000 ++++ console/daemon/io.c +@@ -402,9 +402,7 @@ static int domain_create_tty(struct doma + assert(dom->slave_fd == -1); + assert(dom->master_fd == -1); + +- cfmakeraw(&term); +- +- if (openpty(&dom->master_fd, &dom->slave_fd, NULL, &term, NULL) < 0) { ++ if (openpty(&dom->master_fd, &dom->slave_fd, NULL, NULL, NULL) < 0) { + err = errno; + dolog(LOG_ERR, "Failed to create tty for domain-%d " + "(errno = %i, %s)", +@@ -412,6 +410,22 @@ static int domain_create_tty(struct doma + return 0; + } + ++ if (tcgetattr(dom->slave_fd, &term) < 0) { ++ err = errno; ++ dolog(LOG_ERR, "Failed to get tty attributes for domain-%d " ++ "(errno = %i, %s)", ++ dom->domid, err, strerror(err)); ++ goto out; ++ } ++ cfmakeraw(&term); ++ if (tcsetattr(dom->slave_fd, TCSANOW, &term) < 0) { ++ err = errno; ++ dolog(LOG_ERR, "Failed to set tty attributes for domain-%d " ++ "(errno = %i, %s)", ++ dom->domid, err, strerror(err)); ++ goto out; ++ } ++ + if ((slave = ptsname(dom->master_fd)) == NULL) { + err = errno; + dolog(LOG_ERR, "Failed to get slave name for domain-%d " |