2009-08-04 15:24:23 +02:00
|
|
|
# -*- Mode: makefile -*-
|
|
|
|
|
2009-10-07 02:40:57 +02:00
|
|
|
include ../config-host.mak
|
2009-10-07 02:41:02 +02:00
|
|
|
include config-devices.mak
|
2009-10-07 02:41:00 +02:00
|
|
|
include config-target.mak
|
2009-01-21 19:12:52 +01:00
|
|
|
include $(SRC_PATH)/rules.mak
|
2010-01-06 20:24:05 +01:00
|
|
|
ifneq ($(HWDIR),)
|
|
|
|
include $(HWDIR)/config.mak
|
|
|
|
endif
|
2003-08-10 23:39:31 +02:00
|
|
|
|
2012-05-29 11:49:50 +02:00
|
|
|
$(call set-vpath, $(SRC_PATH))
|
2011-06-23 10:05:12 +02:00
|
|
|
ifdef CONFIG_LINUX
|
|
|
|
QEMU_CFLAGS += -I../linux-headers
|
|
|
|
endif
|
2012-05-29 11:49:50 +02:00
|
|
|
QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target-$(TARGET_BASE_ARCH) -DNEED_CPU_H
|
2008-01-31 12:32:10 +01:00
|
|
|
|
2011-12-04 00:10:08 +01:00
|
|
|
QEMU_CFLAGS+=-I$(SRC_PATH)/include
|
|
|
|
|
2008-01-31 12:32:10 +01:00
|
|
|
ifdef CONFIG_USER_ONLY
|
|
|
|
# user emulator name
|
|
|
|
QEMU_PROG=qemu-$(TARGET_ARCH2)
|
|
|
|
else
|
2003-09-30 22:54:24 +02:00
|
|
|
# system emulator name
|
2011-12-22 11:18:53 +01:00
|
|
|
ifneq (,$(findstring -mwindows,$(LIBS)))
|
|
|
|
# Terminate program name with a 'w' because the linker builds a windows executable.
|
|
|
|
QEMU_PROGW=qemu-system-$(TARGET_ARCH2)w$(EXESUF)
|
|
|
|
endif # windows executable
|
2008-01-31 12:32:10 +01:00
|
|
|
QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
|
2004-04-12 22:39:29 +02:00
|
|
|
endif
|
2003-08-10 23:39:31 +02:00
|
|
|
|
2008-01-31 12:32:10 +01:00
|
|
|
PROGS=$(QEMU_PROG)
|
2011-12-22 11:18:53 +01:00
|
|
|
ifdef QEMU_PROGW
|
|
|
|
PROGS+=$(QEMU_PROGW)
|
|
|
|
endif
|
2010-11-16 21:07:07 +01:00
|
|
|
STPFILES=
|
2003-08-10 23:39:31 +02:00
|
|
|
|
2010-09-20 00:50:45 +02:00
|
|
|
ifndef CONFIG_HAIKU
|
2003-08-10 23:39:31 +02:00
|
|
|
LIBS+=-lm
|
2010-09-20 00:50:45 +02:00
|
|
|
endif
|
2007-01-18 21:06:33 +01:00
|
|
|
|
2009-10-07 02:41:01 +02:00
|
|
|
config-target.h: config-target.h-timestamp
|
|
|
|
config-target.h-timestamp: config-target.mak
|
|
|
|
|
2011-08-31 20:30:43 +02:00
|
|
|
ifdef CONFIG_TRACE_SYSTEMTAP
|
2010-11-12 14:20:25 +01:00
|
|
|
stap: $(QEMU_PROG).stp
|
|
|
|
|
|
|
|
ifdef CONFIG_USER_ONLY
|
|
|
|
TARGET_TYPE=user
|
|
|
|
else
|
|
|
|
TARGET_TYPE=system
|
|
|
|
endif
|
|
|
|
|
2012-03-18 08:47:15 +01:00
|
|
|
$(QEMU_PROG).stp: $(SRC_PATH)/trace-events
|
2012-04-18 20:15:45 +02:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2012-04-03 20:47:39 +02:00
|
|
|
--format=stap \
|
|
|
|
--backend=$(TRACE_BACKEND) \
|
|
|
|
--binary=$(bindir)/$(QEMU_PROG) \
|
|
|
|
--target-arch=$(TARGET_ARCH) \
|
|
|
|
--target-type=$(TARGET_TYPE) \
|
2012-04-18 20:15:45 +02:00
|
|
|
< $< > $@," GEN $(QEMU_PROG).stp")
|
2010-11-12 14:20:25 +01:00
|
|
|
else
|
|
|
|
stap:
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: $(PROGS) stap
|
2009-10-07 02:41:01 +02:00
|
|
|
|
2009-05-25 19:54:53 +02:00
|
|
|
# Dummy command so that make thinks it has done something
|
|
|
|
@true
|
2003-08-10 23:39:31 +02:00
|
|
|
|
2008-01-31 12:32:10 +01:00
|
|
|
#########################################################
|
2003-08-10 23:39:31 +02:00
|
|
|
# cpu emulator library
|
2012-05-29 11:48:59 +02:00
|
|
|
obj-y = exec.o translate-all.o cpu-exec.o
|
2012-05-29 10:55:47 +02:00
|
|
|
obj-y += tcg/tcg.o tcg/optimize.o
|
|
|
|
obj-$(CONFIG_TCG_INTERPRETER) += tci.o
|
|
|
|
obj-y += fpu/softfloat.o
|
|
|
|
obj-y += disas.o
|
|
|
|
obj-$(CONFIG_TCI_DIS) += tci-dis.o
|
2012-05-29 10:23:15 +02:00
|
|
|
obj-y += target-$(TARGET_BASE_ARCH)/
|
2012-05-29 10:55:47 +02:00
|
|
|
obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
|
2012-05-29 10:23:15 +02:00
|
|
|
|
2011-10-19 07:07:18 +02:00
|
|
|
tci-dis.o: QEMU_CFLAGS += -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/tci
|
2003-08-10 23:39:31 +02:00
|
|
|
|
2011-08-01 14:19:05 +02:00
|
|
|
# HELPER_CFLAGS is used for all the legacy code compiled with static register
|
2008-01-31 12:32:10 +01:00
|
|
|
# variables
|
2011-08-01 14:19:05 +02:00
|
|
|
user-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
|
2008-01-31 12:32:10 +01:00
|
|
|
|
2009-08-03 14:46:24 +02:00
|
|
|
# Note: this is a workaround. The real fix is to avoid compiling
|
2011-05-08 13:22:38 +02:00
|
|
|
# cpu_signal_handler() in user-exec.c.
|
2012-05-29 09:33:59 +02:00
|
|
|
%/signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
|
2009-08-03 14:46:24 +02:00
|
|
|
|
2008-01-31 12:32:10 +01:00
|
|
|
#########################################################
|
|
|
|
# Linux user emulator target
|
|
|
|
|
|
|
|
ifdef CONFIG_LINUX_USER
|
|
|
|
|
2011-02-07 07:05:54 +01:00
|
|
|
QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
|
2009-07-16 18:34:03 +02:00
|
|
|
|
2012-05-29 09:33:59 +02:00
|
|
|
obj-y += linux-user/
|
2012-06-10 22:29:19 +02:00
|
|
|
obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y)
|
2008-01-31 12:32:10 +01:00
|
|
|
|
|
|
|
endif #CONFIG_LINUX_USER
|
|
|
|
|
2008-10-26 21:33:16 +01:00
|
|
|
#########################################################
|
|
|
|
# BSD user emulator target
|
|
|
|
|
|
|
|
ifdef CONFIG_BSD_USER
|
|
|
|
|
2009-08-03 14:46:21 +02:00
|
|
|
QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
|
2008-10-26 21:33:16 +01:00
|
|
|
|
2012-05-29 09:33:59 +02:00
|
|
|
obj-y += bsd-user/
|
|
|
|
obj-y += gdbstub.o user-exec.o
|
2008-10-26 21:33:16 +01:00
|
|
|
|
|
|
|
endif #CONFIG_BSD_USER
|
|
|
|
|
2008-01-31 12:32:10 +01:00
|
|
|
#########################################################
|
|
|
|
# System emulator target
|
2009-08-03 14:46:41 +02:00
|
|
|
ifdef CONFIG_SOFTMMU
|
2012-05-29 11:49:34 +02:00
|
|
|
CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
|
|
|
|
CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
|
|
|
|
CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
|
|
|
|
CONFIG_NO_GET_MEMORY_MAPPING = $(if $(subst n,,$(CONFIG_HAVE_GET_MEMORY_MAPPING)),n,y)
|
|
|
|
CONFIG_NO_CORE_DUMP = $(if $(subst n,,$(CONFIG_HAVE_CORE_DUMP)),n,y)
|
2008-01-31 12:32:10 +01:00
|
|
|
|
2012-05-29 11:48:59 +02:00
|
|
|
obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o
|
2012-05-29 11:49:34 +02:00
|
|
|
obj-y += hw/
|
2012-05-29 11:48:59 +02:00
|
|
|
obj-$(CONFIG_KVM) += kvm-all.o
|
2010-04-19 20:59:30 +02:00
|
|
|
obj-$(CONFIG_NO_KVM) += kvm-stub.o
|
2012-04-09 18:50:52 +02:00
|
|
|
obj-y += memory.o savevm.o cputlb.o
|
2012-05-29 11:48:59 +02:00
|
|
|
obj-$(CONFIG_HAVE_GET_MEMORY_MAPPING) += memory_mapping.o
|
|
|
|
obj-$(CONFIG_HAVE_CORE_DUMP) += dump.o
|
2012-06-07 08:22:56 +02:00
|
|
|
obj-$(CONFIG_NO_GET_MEMORY_MAPPING) += memory_mapping-stub.o
|
|
|
|
obj-$(CONFIG_NO_CORE_DUMP) += dump-stub.o
|
2008-01-31 12:32:10 +01:00
|
|
|
LIBS+=-lz
|
2007-11-07 20:24:02 +01:00
|
|
|
|
2009-08-03 14:46:21 +02:00
|
|
|
QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
|
|
|
|
QEMU_CFLAGS += $(VNC_SASL_CFLAGS)
|
2010-07-07 20:57:49 +02:00
|
|
|
QEMU_CFLAGS += $(VNC_JPEG_CFLAGS)
|
2010-07-07 20:57:56 +02:00
|
|
|
QEMU_CFLAGS += $(VNC_PNG_CFLAGS)
|
Add SASL authentication support ("Daniel P. Berrange")
This patch adds the new SASL authentication protocol to the VNC server.
It is enabled by setting the 'sasl' flag when launching VNC. SASL can
optionally provide encryption via its SSF layer, if a suitable mechanism
is configured (eg, GSSAPI/Kerberos, or Digest-MD5). If an SSF layer is
not available, then it should be combined with the x509 VNC authentication
protocol which provides encryption.
eg, if using GSSAPI
qemu -vnc localhost:1,sasl
eg if using TLS/x509 for encryption
qemu -vnc localhost:1,sasl,tls,x509
By default the Cyrus SASL library will look for its configuration in
the file /etc/sasl2/qemu.conf. For non-root users, this can be overridden
by setting the SASL_CONF_PATH environment variable, eg to make it look in
$HOME/.sasl2. NB unprivileged users may not have access to the full range
of SASL mechanisms, since some of them require some administrative privileges
to configure. The patch includes an example SASL configuration file which
illustrates config for GSSAPI and Digest-MD5, though it should be noted that
the latter is not really considered secure any more.
Most of the SASL authentication code is located in a separate source file,
vnc-auth-sasl.c. The main vnc.c file only contains minimal integration
glue, specifically parsing of command line flags / setup, and calls to
start the SASL auth process, to do encoding/decoding for data.
There are several possible stacks for reading & writing of data, depending
on the combo of VNC authentication methods in use
- Clear. read/write straight to socket
- TLS. read/write via GNUTLS helpers
- SASL. encode/decode via SASL SSF layer, then read/write to socket
- SASL+TLS. encode/decode via SASL SSF layer, then read/write via GNUTLS
Hence, the vnc_client_read & vnc_client_write methods have been refactored
a little.
vnc_client_read: main entry point for reading, calls either
- vnc_client_read_plain reading, with no intermediate decoding
- vnc_client_read_sasl reading, with SASL SSF decoding
These two methods, then call vnc_client_read_buf(). This decides
whether to write to the socket directly or write via GNUTLS.
The situation is the same for writing data. More extensive comments
have been added in the code / patch. The vnc_client_read_sasl and
vnc_client_write_sasl method implementations live in the separate
vnc-auth-sasl.c file.
The state required for the SASL auth mechanism is kept in a separate
VncStateSASL struct, defined in vnc-auth-sasl.h and included in the
main VncState.
The configure script probes for SASL and automatically enables it
if found, unless --disable-vnc-sasl was given to override it.
Makefile | 7
Makefile.target | 5
b/qemu.sasl | 34 ++
b/vnc-auth-sasl.c | 626 ++++++++++++++++++++++++++++++++++++++++++++++++++++
b/vnc-auth-sasl.h | 67 +++++
configure | 34 ++
qemu-doc.texi | 97 ++++++++
vnc-auth-vencrypt.c | 12
vnc.c | 249 ++++++++++++++++++--
vnc.h | 31 ++
10 files changed, 1129 insertions(+), 33 deletions(-)
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6724 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-06 21:27:28 +01:00
|
|
|
|
2010-08-19 13:27:56 +02:00
|
|
|
# xen support
|
2012-05-29 11:49:34 +02:00
|
|
|
obj-$(CONFIG_XEN) += xen-all.o xen-mapcache.o
|
2010-08-19 13:27:56 +02:00
|
|
|
obj-$(CONFIG_NO_XEN) += xen-stub.o
|
|
|
|
|
2004-04-12 22:39:29 +02:00
|
|
|
# Hardware support
|
2005-07-02 16:31:34 +02:00
|
|
|
ifeq ($(TARGET_ARCH), sparc64)
|
2012-05-29 10:23:15 +02:00
|
|
|
obj-y += hw/sparc64/
|
2005-07-02 16:31:34 +02:00
|
|
|
else
|
2012-05-29 10:23:15 +02:00
|
|
|
obj-y += hw/$(TARGET_BASE_ARCH)/
|
2009-07-16 18:33:58 +02:00
|
|
|
endif
|
|
|
|
|
2010-03-29 21:23:52 +02:00
|
|
|
main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
|
2009-03-28 07:44:27 +01:00
|
|
|
|
2012-05-29 12:41:34 +02:00
|
|
|
GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
|
2010-01-06 20:24:05 +01:00
|
|
|
|
2009-08-03 14:46:41 +02:00
|
|
|
endif # CONFIG_SOFTMMU
|
2006-10-28 14:19:07 +02:00
|
|
|
|
2012-05-22 13:41:27 +02:00
|
|
|
nested-vars += obj-y
|
|
|
|
|
|
|
|
# This resolves all nested paths, so it must come last
|
|
|
|
include $(SRC_PATH)/Makefile.objs
|
|
|
|
|
|
|
|
all-obj-y = $(obj-y)
|
|
|
|
all-obj-y += $(addprefix ../, $(universal-obj-y))
|
|
|
|
|
|
|
|
ifdef CONFIG_SOFTMMU
|
|
|
|
all-obj-y += $(addprefix ../, $(common-obj-y))
|
|
|
|
all-obj-y += $(addprefix ../libdis/, $(libdis-y))
|
|
|
|
all-obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
|
|
|
|
all-obj-y += $(addprefix ../, $(trace-obj-y))
|
|
|
|
else
|
|
|
|
all-obj-y += $(addprefix ../libuser/, $(user-obj-y))
|
|
|
|
all-obj-y += $(addprefix ../libdis-user/, $(libdis-y))
|
|
|
|
endif #CONFIG_LINUX_USER
|
2012-05-29 09:33:59 +02:00
|
|
|
|
2011-12-22 11:18:53 +01:00
|
|
|
ifdef QEMU_PROGW
|
|
|
|
# The linker builds a windows executable. Make also a console executable.
|
2012-05-22 13:41:27 +02:00
|
|
|
$(QEMU_PROGW): $(all-obj-y)
|
2011-12-22 11:18:53 +01:00
|
|
|
$(call LINK,$^)
|
|
|
|
$(QEMU_PROG): $(QEMU_PROGW)
|
|
|
|
$(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)")
|
|
|
|
else
|
2012-05-22 13:41:27 +02:00
|
|
|
$(QEMU_PROG): $(all-obj-y)
|
2011-08-31 20:30:30 +02:00
|
|
|
$(call LINK,$^)
|
2011-12-22 11:18:53 +01:00
|
|
|
endif
|
2009-07-16 18:34:04 +02:00
|
|
|
|
2011-01-20 21:54:21 +01:00
|
|
|
gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
|
|
|
|
$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@")
|
2008-10-11 19:55:29 +02:00
|
|
|
|
2010-09-30 21:00:22 +02:00
|
|
|
hmp-commands.h: $(SRC_PATH)/hmp-commands.hx
|
2011-01-20 21:54:21 +01:00
|
|
|
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
|
2009-06-06 10:22:04 +02:00
|
|
|
|
2011-09-02 19:34:47 +02:00
|
|
|
qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx
|
2011-01-20 21:54:21 +01:00
|
|
|
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
|
2009-06-06 10:22:04 +02:00
|
|
|
|
2003-08-10 23:39:31 +02:00
|
|
|
clean:
|
2012-06-20 19:02:33 +02:00
|
|
|
rm -f *.a *~ $(PROGS)
|
|
|
|
rm -f $(shell find . -name '*.[od]')
|
2011-09-02 19:34:47 +02:00
|
|
|
rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c
|
2011-08-31 20:30:43 +02:00
|
|
|
ifdef CONFIG_TRACE_SYSTEMTAP
|
2010-11-12 14:20:25 +01:00
|
|
|
rm -f *.stp
|
|
|
|
endif
|
2003-09-30 22:54:24 +02:00
|
|
|
|
2007-09-16 23:08:06 +02:00
|
|
|
install: all
|
2004-03-26 23:43:34 +01:00
|
|
|
ifneq ($(PROGS),)
|
2010-08-05 02:21:34 +02:00
|
|
|
$(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)"
|
|
|
|
ifneq ($(STRIP),)
|
|
|
|
$(STRIP) $(patsubst %,"$(DESTDIR)$(bindir)/%",$(PROGS))
|
|
|
|
endif
|
2004-03-26 23:43:34 +01:00
|
|
|
endif
|
2011-08-31 20:30:43 +02:00
|
|
|
ifdef CONFIG_TRACE_SYSTEMTAP
|
2012-04-18 21:55:41 +02:00
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
|
|
|
|
$(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
|
2010-11-12 14:20:25 +01:00
|
|
|
endif
|
2003-08-10 23:39:31 +02:00
|
|
|
|
2012-05-29 12:41:34 +02:00
|
|
|
GENERATED_HEADERS += config-target.h
|
|
|
|
Makefile: $(GENERATED_HEADERS)
|
|
|
|
|
2007-10-28 14:07:12 +01:00
|
|
|
# Include automatically generated dependency files
|
2012-06-21 22:18:39 +02:00
|
|
|
-include $(wildcard *.d fpu/*.d tcg/*.d)
|