xen-devel
Re: [Xen-devel] [PATCH] fs-backend: fix compile problems
Removed unresolved reference in /usr/src/xen-unstable.hg/tools/ioemu-dir/vl.c:5898: undefined reference to `pci_emulation_add'
/* for (i = 0; i < nb_pci_emulation; i++) { if(pci_emulation_add(pci_emulation_config_text[i]) < 0) { fprintf(stderr, "Warning: could not add PCI device %s\n", pci_emulation_config_text[i]); } } */
"make tools" completed OK. Is it acceptable ?
Boris.
--- On Wed, 3/18/09, Boris Derzhavets <bderzhavets@xxxxxxxxx> wrote:
From: Boris Derzhavets <bderzhavets@xxxxxxxxx> Subject: Re: [Xen-devel] [PATCH] fs-backend: fix compile problems To: "xen-devel" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Stefano Stabellini" <stefano.stabellini@xxxxxxxxxxxxx> Date: Wednesday, March 18, 2009, 10:03 AM
Patch applied and brings to the next expected error :-
make[3]: Entering directory `/usr/src/xen-unstable.hg/tools/fs-back' gcc -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value
-Wdeclaration-after-statement -D__XEN_TOOLS__ -MMD -MF .fs-ops.o.d -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Werror -Wno-unused -fno-strict-aliasing -I../../tools/libxc -I../../tools/include -I../../tools/xenstore -I../../tools/include -I.. -I../lib -I. -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -c -o fs-ops.o fs-ops.c gcc -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -D__XEN_TOOLS__ -MMD -MF .fs-backend.d -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -Werror -Wno-unused -fno-strict-aliasing -I../../tools/libxc -I../../tools/include -I../../tools/xenstore -I../../tools/include -I.. -I../lib -I. -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -o fs-backend fs-xenbus.o fs-ops.o -L. -L.. -L../lib -L../../tools/libxc -lxenctrl -L../../tools/xenstore -lxenstore -lrt fs-backend.c ../../tools/cross-install -m0755 -p fs-backend /usr/src/xen-unstable.hg/dist/install/usr/sbin make[3]: Leaving directory `/usr/src/xen-unstable.hg/tools/fs-back' make[2]: Leaving directory `/usr/src/xen-unstable.hg/tools' make[2]: Entering directory `/usr/src/xen-unstable.hg/tools' set -ex; \ if test -d http://xenbits.xensource.com/git-http/qemu-xen-unstable.git; then \ rm -f ioemu-dir; \ ln -sf http://xenbits.xensource.com/git-http/qemu-xen-unstable.git ioemu-dir; \
else \ if [ ! -d ioemu-remote ]; then \ rm -rf ioemu-remote ioemu-remote.tmp; \ mkdir ioemu-remote.tmp; rmdir ioemu-remote.tmp; \ git clone http://xenbits.xensource.com/git-http/qemu-xen-unstable.git ioemu-remote.tmp; \ if [ "" ]; then \ cd ioemu-remote.tmp; \ git branch -D dummy >/dev/null 2>&1 ||:; \ git checkout -b dummy
; \ cd ..; \ fi; \ mv ioemu-remote.tmp ioemu-remote; \ fi; \ rm -f ioemu-dir; \ ln -sf ioemu-remote ioemu-dir; \ fi + test -d http://xenbits.xensource.com/git-http/qemu-xen-unstable.git + [ ! -d ioemu-remote ] + rm -f ioemu-dir + ln -sf ioemu-remote ioemu-dir set -e; \ case "../" in /*) XEN_ROOT=../ ;; *)
xen_root_lhs=`pwd`; xen_root_rhs=..//; while [ "x${xen_root_rhs#../}" != "x$xen_root_rhs" ]; do xen_root_rhs="${xen_root_rhs#../}"; xen_root_rhs="${xen_root_rhs#/}"; xen_root_rhs="${xen_root_rhs#/}"; xen_root_lhs="${xen_root_lhs%/*}"; done; XEN_ROOT="$xen_root_lhs/$xen_root_rhs" ;; esac; export XEN_ROOT; \ cd ioemu-dir; \ ./xen-setup Install prefix /usr BIOS directory /usr/share/qemu binary directory /usr/bin Manual directory /usr/share/man ELF interp prefix /usr/gnemul/qemu-%M Source path /usr/src/xen-unstable.hg/tools/ioemu-dir C compiler gcc Host C compiler gcc ARCH_CFLAGS -m64 make
make install install host CPU x86_64 host big endian no target list i386-softmmu x86_64-softmmu arm-softmmu cris-softmmu m68k-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu ppc-softmmu ppcemb-softmmu ppc64-softmmu sh4-softmmu sh4eb-softmmu sparc-softmmu i386-linux-user x86_64-linux-user alpha-linux-user arm-linux-user armeb-linux-user cris-linux-user m68k-linux-user mips-linux-user mipsel-linux-user ppc-linux-user ppc64-linux-user ppc64abi32-linux-user sh4-linux-user sh4eb-linux-user sparc-linux-user sparc64-linux-user sparc32plus-linux-user gprof enabled no sparse enabled no profiler no static build no -Werror
enabled no SDL support no OpenGL support curses support no mingw32 support no Audio drivers oss Extra audio cards ac97 es1370 sb16 Mixer emulation no VNC TLS support no kqemu support yes brlapi support no Documentation yes NPTL support yes vde support no AIO support yes Install blobs yes KVM support no - (#error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS) fdt support no The error log from compiling the libSDL test is: /tmp/qemu-conf--9169-.c:1:17: error: SDL.h: No such file or
directory /tmp/qemu-conf--9169-.c: In function ‘main’: /tmp/qemu-conf--9169-.c:3: error: ‘SDL_INIT_VIDEO’ undeclared (first use in this function) /tmp/qemu-conf--9169-.c:3: error: (Each undeclared identifier is reported only once /tmp/qemu-conf--9169-.c:3: error: for each function it appears in.) qemu successfuly configured for Xen qemu-dm build make -C ioemu-dir install make[3]: Entering directory `/usr/src/xen-unstable.hg/tools/ioemu-remote' xen-hooks.mak:56: === pciutils-dev package not found - missing /usr/include/pci xen-hooks.mak:57: === PCI passthrough capability has been disabled make[4]: Entering directory `/usr/src/xen-unstable.hg/tools/ioemu-remote/i386-dm' ../xen-hooks.mak:56: === pciutils-dev package not found - missing /usr/include/pci ../xen-hooks.mak:57: === PCI passthrough capability has been disabled ../xen-hooks.mak:56: === pciutils-dev package not found - missing
/usr/include/pci ../xen-hooks.mak:57: === PCI passthrough capability has been disabled LINK i386-dm/qemu-dm vl.o: In function `main': /usr/src/xen-unstable.hg/tools/ioemu-dir/vl.c:5898: undefined reference to `pci_emulation_add' collect2: ld returned 1 exit status make[4]: *** [qemu-dm] Error 1 make[4]: Leaving directory `/usr/src/xen-unstable.hg/tools/ioemu-remote/i386-dm' make[3]: *** [subdir-i386-dm] Error 2 make[3]: Leaving directory `/usr/src/xen-unstable.hg/tools/ioemu-remote' make[2]: *** [subdir-install-ioemu-dir] Error 2 make[2]: Leaving directory `/usr/src/xen-unstable.hg/tools' make[1]: *** [subdirs-install] Error 2 make[1]: Leaving directory `/usr/src/xen-unstable.hg/tools' make: *** [install-tools] Error 2 root@ServerXen331:/usr/src/xen-unstable.hg#
Boris
--- On Wed, 3/18/09, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
wrote:
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> Subject: [Xen-devel] [PATCH] fs-backend: fix compile problems To: "xen-devel" <xen-devel@xxxxxxxxxxxxxxxxxxx> Date: Wednesday, March 18, 2009, 8:03 AM
Hi all, this patch removes some unused variables and replaces read and write to the pipe with read_exact and write_exact (these two functions are implemented in libxc, that we have to link anyway).
This allows fs-backed to be compiled with -D_FORTIFY_SOURCE=2, hence should fix the problems reported by Boris.
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
diff -r 9fc957e63f8d tools/fs-back/fs-backend.c --- a/tools/fs-back/fs-backend.c Tue Mar 17 15:40:25 2009 +0000 +++ b/tools/fs-back/fs-backend.c Wed Mar 18 12:00:10 2009
+0000 @@ -9,6 +9,7 @@ #include <sys/select.h> #include <sys/socket.h> #include <xen/io/ring.h> +#include <xc_private.h> #include <err.h> #include "sys-queue.h" #include "fs-backend.h" @@ -181,7 +182,6 @@ { struct fs_mount *mount; struct fs_export *export; - int evt_port; struct fsif_sring *sring; uint32_t dom_ids[MAX_RING_SIZE]; int i; @@ -335,12 +335,8 @@ } if (FD_ISSET(pipefds[0], &fds)) { struct fs_request *request; - int ret; - ret = read(pipefds[0], &request, sizeof(struct fs_request *)); - if (ret != sizeof(struct fs_request *)) { - fprintf(stderr, "read request failed\n"); - continue; - } + if (read_exact(pipefds[0], &request, sizeof(struct fs_request *)) < 0) +
err(1, "read request failed\n"); handle_aio_event(request); } LIST_FOREACH(pointer, &mount_requests_head, entries) { @@ -379,7 +375,8 @@ { struct fs_request *request = (struct fs_request*) info->si_value.sival_ptr; int saved_errno = errno; - write(pipefds[1], &request, sizeof(struct fs_request *)); + if (write_exact(pipefds[1], &request, sizeof(struct fs_request *)) < 0) + err(1, "write request filed\n"); errno = saved_errno; } diff -r 9fc957e63f8d tools/fs-back/fs-ops.c --- a/tools/fs-back/fs-ops.c Tue Mar 17 15:40:25 2009 +0000 +++ b/tools/fs-back/fs-ops.c Wed Mar 18 12:00:10 2009 +0000 @@ -49,7 +49,6 @@ { char *file_name, full_path[BUFFER_SIZE]; int fd; - struct timeval tv1, tv2; RING_IDX rsp_idx; fsif_response_t *rsp; uint16_t req_id; @@ -127,7
+126,7 @@ static void dispatch_file_read(struct fs_mount *mount, struct fsif_request *req) { void *buf; - int fd, i, count; + int fd, count; uint16_t req_id; unsigned short priv_id; struct fs_request *priv_req; @@ -169,7 +168,6 @@ priv_req->aiocb.aio_sigevent.sigev_value.sival_ptr = priv_req; assert(aio_read(&priv_req->aiocb) >= 0); -out: /* We can advance the request consumer index, from here on, the request * should not be used (it may be overrinden by a response) */ mount->ring.req_cons++; @@ -198,7 +196,7 @@ static void dispatch_file_write(struct fs_mount *mount, struct fsif_request *req) { void *buf; - int fd, count, i; + int fd, count; uint16_t req_id; unsigned short priv_id; struct fs_request *priv_req; @@ -268,7 +266,6 @@ static void
dispatch_stat(struct fs_mount *mount, struct fsif_request *req) { - struct fsif_stat_response *buf; struct stat stat; int fd, ret; uint16_t req_id;
_______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
_______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|