From: Boris Derzhavets Subject: Re: [PATCH] fs-backend: fix compile problems Date: Wed, 18 Mar 2009 07:03:17 -0700 (PDT) Message-ID: <7003.97944.qm@web56103.mail.re3.yahoo.com> References: <49C0E2F9.2090406@eu.citrix.com> Reply-To: bderzhavets@yahoo.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0318255632==" Return-path: In-Reply-To: <49C0E2F9.2090406@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org --===============0318255632== Content-Type: multipart/alternative; boundary="0-75552650-1237384997=:97944" --0-75552650-1237384997=:97944 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Patch applied and brings to the next expected error :- make[3]: Entering directory `/usr/src/xen-unstable.hg/tools/fs-back' gcc=C2=A0 -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -m64 -g -= fno-strict-aliasing -std=3Dgnu99 -Wall -Wstrict-prototypes -Wno-unused-valu= e -Wdeclaration-after-statement=C2=A0 -D__XEN_TOOLS__ -MMD -MF .fs-ops.o.d= =C2=A0 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE=C2=A0 -Werror -Wno-unused = -fno-strict-aliasing -I../../tools/libxc -I../../tools/include -I../../tool= s/xenstore -I../../tools/include -I.. -I../lib -I. -D_GNU_SOURCE -D_FORTIFY= _SOURCE=3D2 -c -o fs-ops.o fs-ops.c gcc -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -m64 -g -fno-st= rict-aliasing -std=3Dgnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wde= claration-after-statement=C2=A0 -D__XEN_TOOLS__ -MMD -MF .fs-backend.d=C2= =A0 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE=C2=A0 -Werror -Wno-unused -fn= o-strict-aliasing -I../../tools/libxc -I../../tools/include -I../../tools/x= enstore -I../../tools/include -I.. -I../lib -I. -D_GNU_SOURCE -D_FORTIFY_SO= URCE=3D2 -o fs-backend fs-xenbus.o fs-ops.o -L. -L.. -L../lib -L../../tools= /libxc -lxenctrl -L../../tools/xenstore -lxenstore -lrt=C2=A0 fs-backend.c ../../tools/cross-install -m0755 -p fs-backend=C2=A0 /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; \ =C2=A0=C2=A0=C2=A0 if test -d http://xenbits.xensource.com/git-http/qemu-xe= n-unstable.git; then \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 rm -f ioemu-dir; \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ln -sf http://xenbits.xensource.com/g= it-http/qemu-xen-unstable.git ioemu-dir; \ =C2=A0=C2=A0=C2=A0 else \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if [ ! -d ioemu-remote ]; then \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 rm -rf ioemu-remot= e ioemu-remote.tmp; \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 mkdir ioemu-remote= .tmp; rmdir ioemu-remote.tmp; \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 git clone http://x= enbits.xensource.com/git-http/qemu-xen-unstable.git ioemu-remote.tmp; \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if [ "" ]; then=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= cd ioemu-remote.tmp;=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= git branch -D dummy >/dev/null 2>&1 ||:; \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= git checkout -b dummy ;=C2=A0=C2=A0=C2=A0 \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= cd ..;=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 fi;=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 mv ioemu-remote.tm= p ioemu-remote; \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 fi; \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 rm -f ioemu-dir; \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ln -sf ioemu-remote ioemu-dir; \ =C2=A0=C2=A0=C2=A0 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; \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 case "../" in /*) = XEN_ROOT=3D../ ;; *)=C2=A0 xen_root_lhs=3D`pwd`; xen_root_rhs=3D..//; while= [ "x${xen_root_rhs#../}" !=3D "x$xen_root_rhs" ]; do xen_root_rhs=3D"${xen= _root_rhs#../}"; xen_root_rhs=3D"${xen_root_rhs#/}"; xen_root_rhs=3D"${xen_= root_rhs#/}"; xen_root_lhs=3D"${xen_root_lhs%/*}"; done; XEN_ROOT=3D"$xen_r= oot_lhs/$xen_root_rhs" ;; esac; export XEN_ROOT; \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 cd ioemu-dir; \ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ./xen-setup=20 Install prefix=C2=A0=C2=A0=C2=A0 /usr BIOS directory=C2=A0=C2=A0=C2=A0 /usr/share/qemu binary directory=C2=A0 /usr/bin Manual directory=C2=A0 /usr/share/man ELF interp prefix /usr/gnemul/qemu-%M Source path=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /usr/src/xen-unstable.hg/to= ols/ioemu-dir C compiler=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 gcc Host C compiler=C2=A0=C2=A0 gcc ARCH_CFLAGS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -m64 make=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 make install=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 install host CPU=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 x86_64 host big endian=C2=A0=C2=A0 no target list=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 i386-softmmu x86_64-softmmu= arm-softmmu cris-softmmu m68k-softmmu mips-softmmu mipsel-softmmu mips64-s= oftmmu mips64el-softmmu ppc-softmmu ppcemb-softmmu ppc64-softmmu sh4-softmm= u 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-lin= ux-user sh4-linux-user sh4eb-linux-user sparc-linux-user sparc64-linux-user= sparc32plus-linux-user=20 gprof enabled=C2=A0=C2=A0=C2=A0=C2=A0 no sparse enabled=C2=A0=C2=A0=C2=A0 no profiler=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 no static build=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 no -Werror enabled=C2=A0=C2=A0 no SDL support=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 no OpenGL support=C2=A0=C2=A0=C2=A0=20 curses support=C2=A0=C2=A0=C2=A0 no mingw32 support=C2=A0=C2=A0 no Audio drivers=C2=A0=C2=A0=C2=A0=C2=A0 oss Extra audio cards ac97 es1370 sb16 Mixer emulation=C2=A0=C2=A0 no VNC TLS support=C2=A0=C2=A0 no kqemu support=C2=A0=C2=A0=C2=A0=C2=A0 yes brlapi support=C2=A0=C2=A0=C2=A0 no Documentation=C2=A0=C2=A0=C2=A0=C2=A0 yes NPTL support=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 yes vde support=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 no AIO support=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 yes Install blobs=C2=A0=C2=A0=C2=A0=C2=A0 yes KVM support=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 no - (#error Missing KVM ca= pability KVM_CAP_DESTROY_MEMORY_REGION_WORKS) fdt support=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 no The error log from compiling the libSDL test is:=20 /tmp/qemu-conf--9169-.c:1:17: error: SDL.h: No such file or directory /tmp/qemu-conf--9169-.c: In function =E2=80=98main=E2=80=99: /tmp/qemu-conf--9169-.c:3: error: =E2=80=98SDL_INIT_VIDEO=E2=80=99 undeclar= ed (first use in this function) /tmp/qemu-conf--9169-.c:3: error: (Each undeclared identifier is reported o= nly 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: =3D=3D=3D pciutils-dev package not found - missing /usr/i= nclude/pci xen-hooks.mak:57: =3D=3D=3D PCI passthrough capability has been disabled make[4]: Entering directory `/usr/src/xen-unstable.hg/tools/ioemu-remote/i3= 86-dm' ../xen-hooks.mak:56: =3D=3D=3D pciutils-dev package not found - missing /us= r/include/pci ../xen-hooks.mak:57: =3D=3D=3D PCI passthrough capability has been disabled ../xen-hooks.mak:56: =3D=3D=3D pciutils-dev package not found - missing /us= r/include/pci ../xen-hooks.mak:57: =3D=3D=3D PCI passthrough capability has been disabled =C2=A0 LINK=C2=A0 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/i38= 6-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#=20 Boris --- On Wed, 3/18/09, Stefano Stabellini = wrote: From: Stefano Stabellini Subject: [Xen-devel] [PATCH] fs-backend: fix compile problems To: "xen-devel" 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=3D2, hence should fix the problems reported by Boris. Signed-off-by: Stefano Stabellini --- diff -r 9fc957e63f8d tools/fs-back/fs-backend.c --- a/tools/fs-back/fs-backend.c=09Tue Mar 17 15:40:25 2009 +0000 +++ b/tools/fs-back/fs-backend.c=09Wed Mar 18 12:00:10 2009 +0000 @@ -9,6 +9,7 @@ #include #include #include +#include #include #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 =3D read(pipefds[0], &request, sizeof(struct fs_request *)= ); - if (ret !=3D 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);=20 } LIST_FOREACH(pointer, &mount_requests_head, entries) { @@ -379,7 +375,8 @@ { struct fs_request *request =3D (struct fs_request*) info->si_value.sival_ptr; int saved_errno =3D 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 =3D saved_errno; } =20 diff -r 9fc957e63f8d tools/fs-back/fs-ops.c --- a/tools/fs-back/fs-ops.c=09Tue Mar 17 15:40:25 2009 +0000 +++ b/tools/fs-back/fs-ops.c=09Wed 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 =3D priv_req; assert(aio_read(&priv_req->aiocb) >=3D 0); =20 -out:=20 /* We can advance the request consumer index, from here on, the reques= t * 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_reques= t *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 @@ =20 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@lists.xensource.com http://lists.xensource.com/xen-devel =0A=0A=0A --0-75552650-1237384997=:97944 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Patch applied and brings to the next expected= error :-

make[3]: Entering directory `/usr/src/xen-unstable.hg/tool= s/fs-back'
gcc  -O1 -fno-omit-frame-pointer -fno-optimize-sibling-c= alls -m64 -g -fno-strict-aliasing -std=3Dgnu99 -Wall -Wstrict-prototypes -W= no-unused-value -Wdeclaration-after-statement  -D__XEN_TOOLS__ -MMD -M= F .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_SOUR= CE -D_FORTIFY_SOURCE=3D2 -c -o fs-ops.o fs-ops.c
gcc -O1 -fno-omit-frame= -pointer -fno-optimize-sibling-calls -m64 -g -fno-strict-aliasing -std=3Dgn= u99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-stateme= nt  -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/i= nclude -I.. -I../lib -I. -D_GNU_SOURCE -D_FORTIFY_SOURCE=3D2 -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-in= stall -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-uns= table.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 i= oemu-remote ioemu-remote.tmp; \
        &n= bsp;   mkdir ioemu-remote.tmp; rmdir ioemu-remote.tmp; \
 = ;           git clone http://xenbit= s.xensource.com/git-http/qemu-xen-unstable.git ioemu-remote.tmp; \
 = ;           if [ "" ]; then &n= bsp;          \
    &n= bsp;           cd ioemu-remote.tmp;=             \
  &= nbsp;             git branch -= D dummy >/dev/null 2>&1 ||:; \
      =           git checkout -b dummy ;    \
          = ;      cd ..;        &nbs= p;           \
   = ;         fi;      &= nbsp;               =   \
            mv ioe= mu-remote.tmp ioemu-remote; \
        fi; = \
        rm -f ioemu-dir; \
 &nbs= p;      ln -sf ioemu-remote ioemu-dir; \
  = ;  fi
+ test -d http://xenbits.xensource.com/git-http/qemu-xen-unst= able.git
+ [ ! -d ioemu-remote ]
+ rm -f ioemu-dir
+ ln -sf ioemu-= remote ioemu-dir
set -e; \
        &nbs= p;   case "../" in /*) XEN_ROOT=3D../ ;; *)  xen_root_lhs=3D`pwd`; xen_root_rhs=3D..//; while [ "x${xen_root_rhs#../}" = !=3D "x$xen_root_rhs" ]; do xen_root_rhs=3D"${xen_root_rhs#../}"; xen_root_= rhs=3D"${xen_root_rhs#/}"; xen_root_rhs=3D"${xen_root_rhs#/}"; xen_root_lhs= =3D"${xen_root_lhs%/*}"; done; XEN_ROOT=3D"$xen_root_lhs/$xen_root_rhs" ;; = esac; export XEN_ROOT; \
        cd ioemu-= dir; \
        ./xen-setup
Install pre= fix    /usr
BIOS directory    /usr/share/q= emu
binary directory  /usr/bin
Manual directory  /usr/share= /man
ELF interp prefix /usr/gnemul/qemu-%M
Source path  &nb= sp;    /usr/src/xen-unstable.hg/tools/ioemu-dir
C compile= r        gcc
Host C compiler &nb= sp; gcc
ARCH_CFLAGS       -m64
make&nbs= p;             make
install          = ; install
host CPU         = x86_64
host big endian   no
target list   &= nbsp;   i386-softmmu x86_64-softmmu arm-softmmu cris-softmmu m68k= -softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu ppc-so= ftmmu ppcemb-softmmu ppc64-softmmu sh4-softmmu sh4eb-softmmu sparc-softmmu = i386-linux-user x86_64-linux-user alpha-linux-user arm-linux-user armeb-lin= ux-user cris-linux-user m68k-linux-user mips-linux-user mipsel-linux-user p= pc-linux-user ppc64-linux-user ppc64abi32-linux-user sh4-linux-user sh4eb-l= inux-user sparc-linux-user sparc64-linux-user sparc32plus-linux-user
gp= rof 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   &nb= sp; oss
Extra audio cards ac97 es1370 sb16
Mixer emulation  = ; no
VNC TLS support   no
kqemu support   &n= bsp; yes
brlapi support    no
Documentation  = ;   yes
NPTL support      yes
vde = support       no
AIO support  &n= bsp;    yes
Install blobs     yes
= KVM support       no - (#error Missing KVM ca= pability KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
fdt support  &nb= sp;    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 =E2=80=98main=E2=80=99:<= br>/tmp/qemu-conf--9169-.c:3: error: =E2=80=98SDL_INIT_VIDEO=E2=80=99 undec= lared (first use in this function)
/tmp/qemu-conf--9169-.c:3: error: (Ea= ch undeclared identifier is reported only once
/tmp/qemu-conf--9169-.c:3= : error: for each function it appears in.)
qemu successfuly configured f= or Xen qemu-dm build
make -C ioemu-dir install
make[3]: Entering dire= ctory `/usr/src/xen-unstable.hg/tools/ioemu-remote'
xen-hooks.mak:56: = =3D=3D=3D pciutils-dev package not found - missing /usr/include/pci
xen-= hooks.mak:57: =3D=3D=3D PCI passthrough capability has been disabled
mak= e[4]: Entering directory `/usr/src/xen-unstable.hg/tools/ioemu-remote/i386-= dm'
../xen-hooks.mak:56: =3D=3D=3D pciutils-dev package not found - miss= ing /usr/include/pci
../xen-hooks.mak:57: =3D=3D=3D PCI passthrough capa= bility has been disabled
../xen-hooks.mak:56: =3D=3D=3D pciutils-dev pac= kage not found - missing /usr/include/pci
../xen-hooks.mak:57: =3D=3D=3D PCI passthrough capabil= ity has been disabled
  LINK  i386-dm/qemu-dm
vl.o: In func= tion `main':
/usr/src/xen-unstable.hg/tools/ioemu-dir/vl.c:5898: undefin= ed reference to `pci_emulation_add'
collect2: ld returned 1 exit status<= br>make[4]: *** [qemu-dm] Error 1
make[4]: Leaving directory `/usr/src/x= en-unstable.hg/tools/ioemu-remote/i386-dm'
make[3]: *** [subdir-i386-dm]= Error 2
make[3]: Leaving directory `/usr/src/xen-unstable.hg/tools/ioem= u-remote'
make[2]: *** [subdir-install-ioemu-dir] Error 2
make[2]: Le= aving directory `/usr/src/xen-unstable.hg/tools'
make[1]: *** [subdirs-i= nstall] Error 2
make[1]: Leaving directory `/usr/src/xen-unstable.hg/too= ls'
make: *** [install-tools] Error 2
root@ServerXen331:/usr/src/xen-= unstable.hg#

Boris

--- On Wed, 3/18/09, Stefano Stabellin= i <stefano.stabellini@eu.citrix.com> wrote:
From: Stefano Stabellini <stefano.st= abellini@eu.citrix.com>
Subject: [Xen-devel] [PATCH] fs-backend: fix = compile problems
To: "xen-devel" <xen-devel@lists.xensource.com>Date: Wednesday, March 18, 2009, 8:03 AM

Hi all,
this patc= h 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 com= piled with -D_FORTIFY_SOURCE=3D2, hence
should fix the problems reported= by Boris.

Signed-off-by: Stefano Stabellini <stefano.stabellini@= eu.citrix.com>

---

diff -r 9fc957e63f8d tools/fs-back/fs-b= ackend.c
--- a/tools/fs-back/fs-backend.c=09Tue Mar 17 15:40:25 2009 +00= 00
+++ b/tools/fs-back/fs-backend.c=09Wed Mar 18 12:00:10 2009 +0000
@@ -9,6 +9,7 @@
#include <sys/select.h>
#include &l= t;sys/socket.h>
#include <xen/io/ring.h>
+#include <xc_p= rivate.h>
#include <err.h>
#include "sys-queue.h"
#inc= lude "fs-backend.h"
@@ -181,7 +182,6 @@
{
struct fs_mount *m= ount;
struct fs_export *export;
- int evt_port;
struc= t 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 =3D read(pipefds[0], &request, sizeof(stru= ct fs_request *));
- if (ret !=3D sizeof(struct fs_request *)= ) {
- fprintf(stderr, "read request failed\n");
- = continue;
- }
+ if (read_exact(pipef= ds[0], &request, sizeof(struct fs_request
*)) < 0)
+ =20 err(1, "read request failed\n");
handle_aio_event(= request);
}
LIST_FOREACH(pointer, &mount_reque= sts_head, entries) {
@@ -379,7 +375,8 @@
{
struct fs_request= *request =3D (struct fs_request*)
info->si_value.sival_ptr;
= int saved_errno =3D errno;
- write(pipefds[1], &request, sizeof(s= truct fs_request *));
+ if (write_exact(pipefds[1], &request, siz= eof(struct fs_request *))
< 0)
+ err(1, "write request file= d\n");
errno =3D saved_errno;
}

diff -r 9fc957e63f8d to= ols/fs-back/fs-ops.c
--- a/tools/fs-back/fs-ops.c=09Tue Mar 17 15:40:25 = 2009 +0000
+++ b/tools/fs-back/fs-ops.c=09Wed 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 =3D priv_req;
assert(a= io_read(&priv_req->aiocb) >=3D 0);

-out:
/* We c= an advance the request consumer index, from here on, the request
*= should not be used (it may be overrinden by a response) */
mount-&= gt;ring.req_cons++;
@@ -198,7 +196,7 @@
static void dispatch_file_wr= ite(struct fs_mount *mount, struct fsif_request
*req)
{
void= *buf;
- int fd, count, i;
+ int fd, count;
uint16_t re= q_id;
unsigned short priv_id;
struct fs_request *priv_req;<= br>@@ -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;
uint1= 6_t req_id;



_______________________________________________<= br>Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.= xensource.com/xen-devel

=0A=0A = --0-75552650-1237384997=:97944-- --===============0318255632== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0318255632==--