Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KVM #90

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

KVM #90

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion rpm_spec/gui-daemon.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#
#

%define backend_vmm @BACKEND_VMM@

Name: qubes-gui-daemon
Version: @VERSION@
Release: 1%{dist}
Expand Down Expand Up @@ -52,7 +54,9 @@ BuildRequires: libXrandr-devel
BuildRequires: libconfig-devel
BuildRequires: libpng-devel
BuildRequires: libnotify-devel
BuildRequires: xen-devel
%if "%{?backend_vmm}" == "xen"
BuildRequires: xen-devel
%endif
BuildRequires: qubes-db-devel
BuildRequires: help2man
BuildRequires: gcc
Expand Down
14 changes: 9 additions & 5 deletions shmoverride/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
#
#

BACKEND_VMM_PKGCONFIG = $(shell pkg-config --variable=backend_vmm vchan)
BACKEND_VMM ?= $(firstword $(BACKEND_VMM_PKGCONFIG) xen)
ifneq ($(BACKEND_VMM),xen)
$(error shmoverride currently supports Xen only, '$(BACKEND_VMM)' set)
BACKEND_VMM ?= $(shell pkg-config --cflags vchan | sed 's/.*vchan-//')
ifeq ($(filter $(BACKEND_VMM), xen kvm),)
$(error shmoverride currently supports only Xen and KVM, '$(BACKEND_VMM)' set)
endif

LIBDIR ?= /usr/lib64
Expand All @@ -32,12 +31,17 @@ extra_cflags := -g -O2 -I../include/ -fPIC -Wall -Wextra -Werror \
-DSHMOVERRIDE_LIB_PATH=\"$(LIBDIR)/qubes-gui-daemon/shmoverride.so\" \
-I../include -fvisibility=hidden
CC=gcc
LIBS=-ldl

ifeq ($(BACKEND_VMM),xen)
LIBS+=-lxenctrl -lxengnttab
endif

all: shmoverride.so X-wrapper-qubes

shmoverride.so: shmoverride.o ./list.o
$(CC) $(CFLAGS) $(extra_cflags) -shared -o shmoverride.so \
shmoverride.o list.o -ldl -lxenctrl -lxengnttab
shmoverride.o list.o $(LIBS)

vpath %.c ../common

Expand Down
3 changes: 3 additions & 0 deletions shmoverride/shmoverride.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

// #define DEBUG
#ifdef BACKEND_VMM_xen

#define _GNU_SOURCE 1
#define XC_WANT_COMPAT_MAP_FOREIGN_API
Expand Down Expand Up @@ -414,3 +415,5 @@ int __attribute__ ((destructor)) descfunc(void)

return 0;
}

#endif // BACKEND_VMM_xen