qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Fix compilation of nbd on Windows


From: Johannes Schindelin
Subject: Re: [Qemu-devel] [PATCH] Fix compilation of nbd on Windows
Date: Wed, 9 Jul 2008 02:14:17 +0200 (CEST)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

Hi,

On Tue, 8 Jul 2008, Anthony Liguori wrote:

> Johannes Schindelin wrote:
> > This still only supports the client side, and only the TCP version of
> > it, since Windows does not have Unix sockets.
> >
> > Signed-off-by: Johannes Schindelin <address@hidden>
> > ---
> >
> >  This is only compile-tested, since I can only work in an emulated
> >  environment.
> >
> >  Oh, and feel free to reorder nbd.h so that it has only one #ifndef..#endif.
> >
> >  If I find some time next week, I might try to actually compile qemu-nbd and
> >  get it to run on Windows.
> >
> >  Makefile    |    1 +
> >  block-nbd.c |   11 ++++++++++-
> >  nbd.c       |   36 +++++++++++++++++++++++++++++++++++-
> >  nbd.h       |    6 ++++++
> >  4 files changed, 52 insertions(+), 2 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index adb36c6..ef55952 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -70,6 +70,7 @@ endif
> >  
> >  ifdef CONFIG_WIN32
> >  OBJS+=tap-win32.o
> > +LIBS+= -lws2_32
> >  endif
> >  
> >  AUDIO_OBJS = audio.o noaudio.o wavaudio.o mixeng.o
> > diff --git a/block-nbd.c b/block-nbd.c
> > index f350050..a2adbde 100644
> > --- a/block-nbd.c
> > +++ b/block-nbd.c
> > @@ -31,11 +31,17 @@
> >  
> >  #include <sys/types.h>
> >  #include <unistd.h>
> > +#ifdef _WIN32
> > +#include <windows.h>
> > +#include <winsock2.h>
> > +#include <ws2tcpip.h>
> > +#else
> >  #include <sys/socket.h>
> >  #include <sys/un.h>
> >  #include <netinet/in.h>
> >  #include <arpa/inet.h>
> >  #include <pthread.h>
> > +#endif
> >   
> 
> qemu_socket.h already does this for you.

Thanks!  That was actually very useful advice!

Note that I will likely have to do different things until later this 
week, but then I will definitely take this advice into account, and try to 
get qemu-nbd going (tcp-only) on Windows.

Ciao,
Dscho




reply via email to

[Prev in Thread] Current Thread [Next in Thread]