@@ -25,7 +25,7 @@ stub-obj-y += mon-set-error.o
stub-obj-y += monitor-init.o
stub-obj-y += notify-event.o
stub-obj-y += pci-drive-hot-add.o
-stub-obj-y += qemu-chr-open-spice.o
+stub-obj-$(CONFIG_SPICE) += qemu-chr-open-spice.o
stub-obj-y += qtest.o
stub-obj-y += reset.o
stub-obj-y += runstate-check.o
@@ -6,7 +6,9 @@ CharDriverState *qemu_chr_open_spice_vmc(const char *type)
return NULL;
}
+#if SPICE_SERVER_VERSION >= 0x000c02
CharDriverState *qemu_chr_open_spice_port(const char *name)
{
return NULL;
}
+#endif
build stub/qemu-chr-open-spice.o only with CONFIG_SPICE, this suppresses the warning when building without CONFIG_SPICE. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> --- stubs/Makefile.objs | 2 +- stubs/qemu-chr-open-spice.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) v2: - add version check for qemu_chr_open_spice_port()