xen: update to 4.0.1!

This commit is contained in:
Juan RP 2011-01-10 12:03:00 +01:00
parent e6abf71b04
commit 0fb57ca0c4
4 changed files with 306 additions and 31 deletions

View file

@ -0,0 +1,265 @@
Do not redefine READ and WRITE, which are defined in linux/fs.h. Instead prefix them
with XEN to avoid namespace clash.
--- tools/blktap2/include/blktaplib.h.orig 2011-01-10 11:10:18.362560374 +0100
+++ tools/blktap2/include/blktaplib.h 2011-01-10 11:11:53.007679832 +0100
@@ -197,8 +197,8 @@ typedef struct msg_lock {
int uuid_len;
} msg_lock_t;
-#define READ 0
-#define WRITE 1
+#define XEN_READ 0
+#define XEN_WRITE 1
/*Control Messages between manager and tapdev*/
#define CTLMSG_PARAMS 1
--- tools/blktap/lib/blktaplib.h.orig 2011-01-10 11:12:38.633561491 +0100
+++ tools/blktap/lib/blktaplib.h 2011-01-10 11:12:47.110717080 +0100
@@ -195,8 +195,8 @@ typedef struct msg_pid {
pid_t pid;
} msg_pid_t;
-#define READ 0
-#define WRITE 1
+#define XEN_READ 0
+#define XEN_WRITE 1
/*Control Messages between manager and tapdev*/
#define CTLMSG_PARAMS 1
--- tools/blktap/drivers/blktapctrl.c.orig 2010-08-25 12:22:07.000000000 +0200
+++ tools/blktap/drivers/blktapctrl.c 2011-01-10 11:30:15.176697136 +0100
@@ -128,13 +128,13 @@ static int get_tapdisk_pid(blkif_t *blki
{
int ret;
- if ((ret = write_msg(blkif->fds[WRITE], CTLMSG_PID, blkif, NULL))
+ if ((ret = write_msg(blkif->fds[XEN_WRITE], CTLMSG_PID, blkif, NULL))
<= 0) {
DPRINTF("Write_msg failed - CTLMSG_PID(%d)\n", ret);
return -EINVAL;
}
- if ((ret = read_msg(blkif->fds[READ], CTLMSG_PID_RSP, blkif))
+ if ((ret = read_msg(blkif->fds[XEN_READ], CTLMSG_PID_RSP, blkif))
<= 0) {
DPRINTF("Read_msg failure - CTLMSG_PID(%d)\n", ret);
return -EINVAL;
@@ -576,8 +576,8 @@ static int connect_qemu(blkif_t *blkif,
}
DPRINTF("Using tapdisk-ioemu connection\n");
- blkif->fds[READ] = dom0_readfd;
- blkif->fds[WRITE] = dom0_writefd;
+ blkif->fds[XEN_READ] = dom0_readfd;
+ blkif->fds[XEN_WRITE] = dom0_writefd;
if (refresh_pid) {
get_tapdisk_pid(blkif);
@@ -587,8 +587,8 @@ static int connect_qemu(blkif_t *blkif,
} else if (access(rdctldev, R_OK | W_OK) == 0) {
/* Use existing pipe to the device model */
DPRINTF("Using qemu-dm connection\n");
- blkif->fds[READ] = open_ctrl_socket(wrctldev);
- blkif->fds[WRITE] = open_ctrl_socket(rdctldev);
+ blkif->fds[XEN_READ] = open_ctrl_socket(wrctldev);
+ blkif->fds[XEN_WRITE] = open_ctrl_socket(rdctldev);
} else {
/* No device model => try with tapdisk-ioemu */
DPRINTF("No device model\n");
@@ -598,7 +598,7 @@ static int connect_qemu(blkif_t *blkif,
free(rdctldev);
free(wrctldev);
- if (blkif->fds[READ] == -1 || blkif->fds[WRITE] == -1)
+ if (blkif->fds[XEN_READ] == -1 || blkif->fds[XEN_WRITE] == -1)
return -1;
DPRINTF("Attached to qemu blktap pipes\n");
@@ -621,10 +621,10 @@ static int connect_tapdisk(blkif_t *blki
"%s/tapctrlwrite%d", BLKTAP_CTRL_DIR, minor) == -1)
goto fail;
- blkif->fds[READ] = open_ctrl_socket(rdctldev);
- blkif->fds[WRITE] = open_ctrl_socket(wrctldev);
+ blkif->fds[XEN_READ] = open_ctrl_socket(rdctldev);
+ blkif->fds[XEN_WRITE] = open_ctrl_socket(wrctldev);
- if (blkif->fds[READ] == -1 || blkif->fds[WRITE] == -1)
+ if (blkif->fds[XEN_READ] == -1 || blkif->fds[XEN_WRITE] == -1)
goto fail;
/*launch the new process*/
@@ -683,8 +683,8 @@ static int blktapctrl_new_blkif(blkif_t
} else {
DPRINTF("Process exists!\n");
- blkif->fds[READ] = exist->fds[READ];
- blkif->fds[WRITE] = exist->fds[WRITE];
+ blkif->fds[XEN_READ] = exist->fds[XEN_READ];
+ blkif->fds[XEN_WRITE] = exist->fds[XEN_WRITE];
}
add_disktype(blkif, type);
@@ -703,13 +703,13 @@ static int blktapctrl_new_blkif(blkif_t
/* Both of the following read and write calls will block up to
* max_timeout val*/
- if (write_msg(blkif->fds[WRITE], CTLMSG_PARAMS, blkif, ptr)
+ if (write_msg(blkif->fds[XEN_WRITE], CTLMSG_PARAMS, blkif, ptr)
<= 0) {
DPRINTF("Write_msg failed - CTLMSG_PARAMS\n");
goto fail;
}
- if (read_msg(blkif->fds[READ], CTLMSG_IMG, blkif) <= 0) {
+ if (read_msg(blkif->fds[XEN_READ], CTLMSG_IMG, blkif) <= 0) {
DPRINTF("Read_msg failure - CTLMSG_IMG\n");
goto fail;
}
@@ -725,12 +725,12 @@ fail:
static int map_new_blktapctrl(blkif_t *blkif)
{
DPRINTF("Received a poll for a new devmap\n");
- if (write_msg(blkif->fds[WRITE], CTLMSG_NEWDEV, blkif, NULL) <= 0) {
+ if (write_msg(blkif->fds[XEN_WRITE], CTLMSG_NEWDEV, blkif, NULL) <= 0) {
DPRINTF("Write_msg failed - CTLMSG_NEWDEV\n");
return -EINVAL;
}
- if (read_msg(blkif->fds[READ], CTLMSG_NEWDEV_RSP, blkif) <= 0) {
+ if (read_msg(blkif->fds[XEN_READ], CTLMSG_NEWDEV_RSP, blkif) <= 0) {
DPRINTF("Read_msg failed - CTLMSG_NEWDEV_RSP\n");
return -EINVAL;
}
@@ -743,15 +743,15 @@ static int unmap_blktapctrl(blkif_t *blk
{
DPRINTF("Unmapping vbd\n");
- if (write_msg(blkif->fds[WRITE], CTLMSG_CLOSE, blkif, NULL) <= 0) {
+ if (write_msg(blkif->fds[XEN_WRITE], CTLMSG_CLOSE, blkif, NULL) <= 0) {
DPRINTF("Write_msg failed - CTLMSG_CLOSE\n");
return -EINVAL;
}
if (del_disktype(blkif)) {
DPRINTF("Closing communication pipe to pid %d\n", blkif->tappid);
- close(blkif->fds[WRITE]);
- close(blkif->fds[READ]);
+ close(blkif->fds[XEN_WRITE]);
+ close(blkif->fds[XEN_READ]);
}
return 0;
--- tools/blktap/drivers/tapdisk.c.orig 2011-01-10 11:33:42.160375869 +0100
+++ tools/blktap/drivers/tapdisk.c 2011-01-10 11:36:42.820168882 +0100
@@ -138,10 +138,10 @@ static inline int LOCAL_FD_SET(fd_set *r
if (ptr->tap_fd) {
FD_SET(ptr->tap_fd, readfds);
td_for_each_disk(ptr->s, dd) {
- if (dd->io_fd[READ])
- FD_SET(dd->io_fd[READ], readfds);
- maxfds = (dd->io_fd[READ] > maxfds ?
- dd->io_fd[READ] : maxfds);
+ if (dd->io_fd[INPUT])
+ FD_SET(dd->io_fd[INPUT], readfds);
+ maxfds = (dd->io_fd[INPUT] > maxfds ?
+ dd->io_fd[INPUT] : maxfds);
}
maxfds = (ptr->tap_fd > maxfds ? ptr->tap_fd : maxfds);
}
@@ -380,7 +380,7 @@ static int read_msg(char *buf)
struct td_state *s = NULL;
fd_list_entry_t *entry;
- length = read(fds[READ], buf, MSG_SIZE);
+ length = read(fds[INPUT], buf, MSG_SIZE);
if (length > 0 && length >= sizeof(msg_hdr_t))
{
@@ -435,7 +435,7 @@ static int read_msg(char *buf)
msg->type = CTLMSG_IMG_FAIL;
msg->len = msglen;
}
- len = write(fds[WRITE], buf, msglen);
+ len = write(fds[OUTPUT], buf, msglen);
free(path);
return 1;
@@ -457,7 +457,7 @@ static int read_msg(char *buf)
: CTLMSG_NEWDEV_FAIL);
msg->len = msglen;
- len = write(fds[WRITE], buf, msglen);
+ len = write(fds[OUTPUT], buf, msglen);
return 1;
case CTLMSG_CLOSE:
@@ -479,7 +479,7 @@ static int read_msg(char *buf)
process = getpid();
msg_pid->pid = process;
- len = write(fds[WRITE], buf, msglen);
+ len = write(fds[OUTPUT], buf, msglen);
return 1;
default:
@@ -782,12 +782,12 @@ int main(int argc, char *argv[])
signal (SIGINT, sig_handler);
/*Open the control channel*/
- fds[READ] = open(argv[1],O_RDWR|O_NONBLOCK);
- fds[WRITE] = open(argv[2],O_RDWR|O_NONBLOCK);
+ fds[INPUT] = open(argv[1],O_RDWR|O_NONBLOCK);
+ fds[OUTPUT] = open(argv[2],O_RDWR|O_NONBLOCK);
- if ( (fds[READ] < 0) || (fds[WRITE] < 0) )
+ if ( (fds[INPUT] < 0) || (fds[OUTPUT] < 0) )
{
- DPRINTF("FD open failed [%d,%d]\n", fds[READ], fds[WRITE]);
+ DPRINTF("FD open failed [%d,%d]\n", fds[INPUT], fds[OUTPUT]);
exit(-1);
}
@@ -803,8 +803,8 @@ int main(int argc, char *argv[])
{
ret = 0;
FD_ZERO(&readfds);
- FD_SET(fds[READ], &readfds);
- maxfds = fds[READ];
+ FD_SET(fds[INPUT], &readfds);
+ maxfds = fds[INPUT];
/*Set all tap fds*/
LOCAL_FD_SET(&readfds);
@@ -822,10 +822,10 @@ int main(int argc, char *argv[])
tapdev_info_t *info = ptr->s->ring_info;
td_for_each_disk(ptr->s, dd) {
- if (dd->io_fd[READ] &&
- FD_ISSET(dd->io_fd[READ],
+ if (dd->io_fd[INPUT] &&
+ FD_ISSET(dd->io_fd[INPUT],
&readfds)) {
- io_done(dd, READ);
+ io_done(dd, INPUT);
progress_made = 1;
}
}
@@ -851,13 +851,13 @@ int main(int argc, char *argv[])
ptr = ptr->next;
}
- if (FD_ISSET(fds[READ], &readfds))
+ if (FD_ISSET(fds[INPUT], &readfds))
read_msg(buf);
}
}
free(buf);
- close(fds[READ]);
- close(fds[WRITE]);
+ close(fds[INPUT]);
+ close(fds[OUTPUT]);
ptr = fd_start;
while (ptr != NULL) {

View file

@ -0,0 +1,13 @@
Pass library list to link in the correct place to avoid missing symbols.
--- tools/libxc/Makefile.orig 2011-01-10 11:13:56.365905921 +0100
+++ tools/libxc/Makefile 2011-01-10 11:14:12.261224745 +0100
@@ -174,7 +174,7 @@ xc_dom_bzimageloader.opic: CFLAGS += $(c
libxenguest.so.$(MAJOR).$(MINOR): LDFLAGS += $(call zlib-options,l)
libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
- $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz -lxenctrl $(PTHREAD_LIBS)
+ $(CC) $(CFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz -lxenctrl $(PTHREAD_LIBS) $(LDFLAGS)
-include $(DEPS)

View file

@ -1,43 +1,32 @@
# Template file for 'xen'
pkgname=xen
version=4.0.0
revision=1
version=4.0.1
wrksrc=xen-${version}
distfiles="http://bits.xensource.com/oss-xen/release/$version/xen-$version.tar.gz"
build_style=gnu_makefile
make_build_target="DISTDIR=$XBPS_DESTDIR/$pkgname-$version xen tools"
make_install_target="install-xen install-tools"
build_style=custom-install
short_desc="Xen Hypervisor and Utilities"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=ea4757d7947b64f01d6e850f34048db7e053731f626d8342b6a15dee8b871289
checksum=6e6d1d29400db93cb8095e034138aa8748b1bd4cffb4d3fd07af4ba15c918873
long_desc="
This package provides the official Xen Hypervisor and related utilities
for starting/stopping/accessing unprivileged domains (domUs)."
broken_as_needed=yes
nostrip=yes
subpackages="xen-devel"
openrc_services="xend default true"
conf_files="
/etc/sysconfig/xend
/etc/sysconfig/xendomains
/etc/xen/xmexample.pv-grub
/etc/xen/xm-config.xml
/etc/xen/xmexample.hvm
/etc/xen/xmexample1
/etc/xen/xend-config.sxp
/etc/xen/qemu-ifup
/etc/xen/xmexample.hvm-stubdom
/etc/xen/xend-pci-quirks.sxp
/etc/xen/xmexample.vti
/etc/xen/xmexample.nbd
/etc/xen/xend-pci-permissive.sxp
/etc/xen/xmexample2"
/etc/xen/xm-config.xml"
Add_dependency run glibc
Add_dependency run libuuid
Add_dependency run e2fsprogs-libs
Add_dependency run bzip2
Add_dependency run xz
Add_dependency run zlib
Add_dependency run liblzma
Add_dependency run gnutls
Add_dependency run libbluetooth
Add_dependency run pciutils
@ -47,11 +36,9 @@ Add_dependency run libXext
Add_dependency run MesaLib
Add_dependency run ncurses-libs
Add_dependency run libgcrypt
Add_dependency full python
Add_dependency full iproute2
Add_dependency build e2fsprogs-devel
Add_dependency build bzip2-devel
Add_dependency build xz-devel
Add_dependency build zlib-devel
Add_dependency build gnutls-devel
Add_dependency build libbluetooth-devel
@ -62,25 +49,32 @@ Add_dependency build libXext-devel
Add_dependency build MesaLib-devel
Add_dependency build ncurses-devel
Add_dependency build libgcrypt-devel
Add_dependency build libuuid-devel
Add_dependency build liblzma-devel
Add_dependency build dev86
Add_dependency build acpica-utils
pre_build()
{
# Use tools from coreutils.
export PATH="/bin:/sbin:/usr/bin:/usr/sbin:$PATH"
Add_dependency full python
Add_dependency full net-tools # Requires ifconfig
Add_dependency full iproute2 # Requires ip
Add_dependency full bridge-utils # Required brctl
do_build()
{
install -d ${DESTDIR}
cd ${DESTDIR} && ln -sf . install
cd ${wrksrc} && make ${makejobs} DISTDIR=${DESTDIR} xen tools
}
do_install()
{
if [ "${xbps_machine}" = "x86_64" ]; then
install -d ${DESTDIR}/usr/lib
cd ${DESTDIR}/usr && ln -s lib lib64 && cd ${wrksrc}
fi
}
post_install()
{
make DESTDIR=${DESTDIR} install-xen install-tools
# Remove upstream xend and use our own.
rm -f ${DESTDIR}/etc/init.d/xend
install -m755 ${FILESDIR}/xend.rc ${DESTDIR}/etc/init.d/xend

View file

@ -453,11 +453,14 @@ libopenobex.so libopenobex libopenobex-devel
libntfs-3g.so.80 ntfs-3g ntfs-3g-devel
libruby.so.1 ruby ruby-devel
libfsimage.so.1 xen xen-devel
libxenctrl.so.3 xen xen-devel
libxenctrl.so.4 xen xen-devel
libxenstore.so.3 xen xen-devel
libflask.so.1 xen xen-devel
libblktap.so.3 xen xen-devel
libxenguest.so.3 xen xen-devel
libxenguest.so.4 xen xen-devel
libxenlight.so.1 xen xen-devel
libxlutil.so.1 xen xen-devel
libvhd.so.1 xen xen-devel
libbabl-0.1.so babl babl-devel
libgegl-0.1.so gegl gegl-devel
libiculx.so.42 icu-libs icu-devel