From 8cef4895bc4c14682f801e7997e0da0beb30d06d Mon Sep 17 00:00:00 2001 From: rd235 Date: Wed, 28 Dec 2005 10:19:43 +0000 Subject: [PATCH] QEMU version check added (automatic syntax conversion) git-svn-id: https://vde.svn.sourceforge.net/svnroot/vde/trunk@73 d37a7db1-d92d-0410-89df-f68f52f87b57 --- vde-2/qemu/Makefile.am | 2 -- vde-2/qemu/vdeq.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- vde/qemu/Makefile.am | 5 +++-- vde/qemu/vdeq.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 91 insertions(+), 6 deletions(-) diff --git a/vde-2/qemu/Makefile.am b/vde-2/qemu/Makefile.am index 25a8af6..7cf04e7 100644 --- a/vde-2/qemu/Makefile.am +++ b/vde-2/qemu/Makefile.am @@ -9,9 +9,7 @@ install-exec-hook: rm -f $(DESTDIR)$(bindir)/vdeqemu $(LN_S) $(DESTDIR)$(bindir)/vdeq $(DESTDIR)$(bindir)/vdeqemu rm -f $(DESTDIR)$(bindir)/vdeo - $(LN_S) $(DESTDIR)$(bindir)/vdeq $(DESTDIR)$(bindir)/vdeo rm -f $(DESTDIR)$(bindir)/vdeoqemu - $(LN_S) $(DESTDIR)$(bindir)/vdeq $(DESTDIR)$(bindir)/vdeoqemu uninstall-local: rm -f $(bindir)/vdeqemu diff --git a/vde-2/qemu/vdeq.c b/vde-2/qemu/vdeq.c index b9235b3..172cd90 100644 --- a/vde-2/qemu/vdeq.c +++ b/vde-2/qemu/vdeq.c @@ -174,6 +174,46 @@ static void leave() exit(0); } +static int checkver(char *prog) +{ + char *newargv[3]; + int fd[2]; + int f,len,version=0; + char buf[257]; + newargv[0]=prog; + newargv[1]="-h"; + newargv[2]=0; + buf[256]=0; + pipe(fd); + if ((f=fork()) > 0) { + int status; + close(fd[1]); + len=read(fd[0],buf,256); + if (len>0) { + int i; + for(i=0;i 0) @@ -269,11 +312,11 @@ int main(int argc, char **argv) strcmp(filename,"--help")==0 )) { usage(); - } else if (argc > args+1 && + } else if (argc > args+1 && ( (strcmp(argv[args],"-vdesock")==0) || (strcmp(argv[args],"-sock")==0) || (strcmp(argv[args],"-unix")==0) || - (strcmp(argv[args],"-s")==0) + (strcmp(argv[args],"-s")==0)) ){ argsock=argv[args+1]; args+=2; diff --git a/vde/qemu/Makefile.am b/vde/qemu/Makefile.am index 89ab43c..1855a34 100644 --- a/vde/qemu/Makefile.am +++ b/vde/qemu/Makefile.am @@ -8,8 +8,9 @@ EXTRA_DIST = README install-exec-hook: rm -f $(DESTDIR)$(bindir)/vdeqemu $(LN_S) $(DESTDIR)$(bindir)/vdeq $(DESTDIR)$(bindir)/vdeqemu - $(LN_S) $(DESTDIR)$(bindir)/vdeq $(DESTDIR)$(bindir)/vdeo - $(LN_S) $(DESTDIR)$(bindir)/vdeq $(DESTDIR)$(bindir)/vdeoqemu + rm -f $(DESTDIR)$(bindir)/vdeo + rm -f $(DESTDIR)$(bindir)/vdeoqemu + uninstall-local: rm -f $(bindir)/vdeqemu diff --git a/vde/qemu/vdeq.c b/vde/qemu/vdeq.c index c46381f..0443968 100644 --- a/vde/qemu/vdeq.c +++ b/vde/qemu/vdeq.c @@ -138,6 +138,46 @@ static void leave() } +static int checkver(char *prog) +{ + char *newargv[3]; + int fd[2]; + int f,len,version=0; + char buf[257]; + newargv[0]=prog; + newargv[1]="-h"; + newargv[2]=0; + buf[256]=0; + pipe(fd); + if ((f=fork()) > 0) { + int status; + close(fd[1]); + len=read(fd[0],buf,256); + if (len>0) { + int i; + for(i=0;i 0) -- 2.11.4.GIT