On 10 June 2014 01:56, Paolo Bonzini <pbonz...@redhat.com> wrote: > From: Michael Tokarev <m...@tls.msk.ru> > > Use glib-provided thread primitives in vscclient instead of > qemu ones, and do not use qemu sockets in there (open-code > call to WSAStartup() for windows to initialize things). > > This way, vscclient becomes more stand-alone, independent on > qemu internals. > > Signed-off-by: Michael Tokarev <m...@tls.msk.ru> > Reviewed-by: Alon Levy <al...@redhat.com> > Tested-by: Alon Levy <al...@redhat.com> > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > --- > libcacard/vscclient.c | 70 > +++++++++++++++++++++++++++------------------------ > 1 file changed, 37 insertions(+), 33 deletions(-) > > diff --git a/libcacard/vscclient.c b/libcacard/vscclient.c > index 6693900..ab9b2b8 100644 > --- a/libcacard/vscclient.c > +++ b/libcacard/vscclient.c > @@ -12,12 +12,10 @@ > > #ifndef _WIN32 > #include <netdb.h> > +#define closesocket(x) close(x) > #endif > -#include <glib.h> > > #include "qemu-common.h" > -#include "qemu/thread.h" > -#include "qemu/sockets.h"
This change breaks the build on FreeBSD: libcacard/vscclient.c: In function 'send_msg': libcacard/vscclient.c:111: warning: implicit declaration of function 'htonl' libcacard/vscclient.c:111: warning: nested extern declaration of 'htonl' libcacard/vscclient.c: In function 'on_host_init': libcacard/vscclient.c:248: warning: implicit declaration of function 'ntohl' libcacard/vscclient.c:248: warning: nested extern declaration of 'ntohl' libcacard/vscclient.c: In function 'connect_to_qemu': libcacard/vscclient.c:601: warning: implicit declaration of function 'socket' libcacard/vscclient.c:601: warning: nested extern declaration of 'socket' ...