Use xenstore.h instead of xs.h when xen >= 4.2

This commit is contained in:
Davíð Steinn Geirsson 2014-04-21 15:21:03 +00:00 committed by Marek Marczykowski-Górecki
parent 2ddea415b2
commit e5fa610b0d
3 changed files with 11 additions and 1 deletions

View File

@ -1,5 +1,11 @@
CC=gcc
CFLAGS=-Wall -Wextra -Werror -g -O3
_XENSTORE_H=$(wildcard /usr/include/xenstore.h)
ifneq "$(_XENSTORE_H)" ""
CFLAGS+= -DUSE_XENSTORE_H
endif
all: xenstore-watch python close-window
xenstore-watch: xenstore-watch.o
$(CC) -o xenstore-watch xenstore-watch.o -lxenstore

View File

@ -1,5 +1,9 @@
#include <sys/types.h>
#ifdef USE_XENSTORE_H
#include <xenstore.h>
#else
#include <xs.h>
#endif
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)

View File

@ -3,7 +3,7 @@
if [ -x /usr/sbin/xenstore-read ]; then
XENSTORE_READ="/usr/sbin/xenstore-read"
else
XENSTORE_READ="$XENSTORE_READ"
XENSTORE_READ="/usr/bin/xenstore-read"
fi
ip=`$XENSTORE_READ qubes-ip 2> /dev/null`