From nobody Tue Feb 10 04:17:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1597397766; cv=none; d=zohomail.com; s=zohoarc; b=eaNAJfHmxPdRtICa/FZNndzpXkaIQ/xwJ8rpGJRFee8eGcfziZFaBLXQXIOU3d0yBFFlh17pHvja3v0rlbYCxZqtfMqUP9lU5fi4E9SIhfb794onMoxXljjn0dPHqRpxOVsJ2Kl1VxsSlccIqXlO45vY0vk5RBQbRoJuYLJCYec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597397766; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wwCIfVLh8b0fYliQAUAMhqvIE48cFXJsHpj9Zx5tun8=; b=mN9vM6s+AjG3XU0N2E26E5fg4VQMhSjH/gV+bLwGn6H7uU90yDNDTinN6hXmAuGFf39rpHwJjd5zdmPMc3yi0yYlqQLbj/DM6qm77fBWMVbEpiV7GTwbeYD1mLxdDuu4ACvAHWTmn9fSMtFCMfLSqljv+gSG3kIHdtrXKZJMRSI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1597397766733497.6305992137417; Fri, 14 Aug 2020 02:36:06 -0700 (PDT) Received: from localhost ([::1]:39926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6W85-0002GN-Ca for importer@patchew.org; Fri, 14 Aug 2020 05:36:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6Vmv-0005q3-9o for qemu-devel@nongnu.org; Fri, 14 Aug 2020 05:14:13 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:20691 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k6Vmm-0002vE-BX for qemu-devel@nongnu.org; Fri, 14 Aug 2020 05:14:12 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-127-kwiLgZQxONW03eZhKv9PBw-1; Fri, 14 Aug 2020 05:13:57 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 939141015DBC for ; Fri, 14 Aug 2020 09:13:56 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C86C1002382; Fri, 14 Aug 2020 09:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597396441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wwCIfVLh8b0fYliQAUAMhqvIE48cFXJsHpj9Zx5tun8=; b=SRJu5kYhQh2sBXFALRlkc0GGWRTNDkCVOnGnzLYjS5Tx0VB1vf3W8vrEeiQ5c2RAq2c8wt 27PWCDp8s3WcQda++KwQqnuxT08KY6JqqF6XlJKzZccihu5Hj/gi1xnpRR6aYMN813DbO+ KhNApRuul1AuGvUthS6L6qkfU9j6oOw= X-MC-Unique: kwiLgZQxONW03eZhKv9PBw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 040/150] meson: convert qemu-ga Date: Fri, 14 Aug 2020 05:11:36 -0400 Message-Id: <20200814091326.16173-41-pbonzini@redhat.com> In-Reply-To: <20200814091326.16173-1-pbonzini@redhat.com> References: <20200814091326.16173-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=pbonzini@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/14 05:13:35 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- Makefile | 53 +++++---------------------------------- Makefile.objs | 1 - configure | 14 +++-------- meson.build | 8 ++++++ qga/Makefile.objs | 9 ------- qga/installer/qemu-ga.wxs | 2 +- qga/meson.build | 46 +++++++++++++++++++++++++++++++++ tests/Makefile.include | 4 +-- tests/test-qga.c | 8 +++--- 9 files changed, 71 insertions(+), 74 deletions(-) create mode 100644 qga/meson.build diff --git a/Makefile b/Makefile index 653c16bb0d..db535c7fc8 100644 --- a/Makefile +++ b/Makefile @@ -292,7 +292,6 @@ endif dummy :=3D $(call unnest-vars,, \ authz-obj-y \ chardev-obj-y \ - qga-obj-y \ qga-vss-dll-obj-y \ block-obj-y \ block-obj-m \ @@ -440,52 +439,15 @@ endif qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@= ") =20 -qemu-ga$(EXESUF): LIBS =3D $(LIBS_QGA) -qemu-ga$(EXESUF): QEMU_CFLAGS +=3D -I qga/qapi-generated - qemu-keymap$(EXESUF): LIBS +=3D $(XKBCOMMON_LIBS) qemu-keymap$(EXESUF): QEMU_CFLAGS +=3D $(XKBCOMMON_CFLAGS) =20 -qapi-py =3D $(SRC_PATH)/scripts/qapi/__init__.py \ -$(SRC_PATH)/scripts/qapi/commands.py \ -$(SRC_PATH)/scripts/qapi/common.py \ -$(SRC_PATH)/scripts/qapi/doc.py \ -$(SRC_PATH)/scripts/qapi/error.py \ -$(SRC_PATH)/scripts/qapi/events.py \ -$(SRC_PATH)/scripts/qapi/expr.py \ -$(SRC_PATH)/scripts/qapi/gen.py \ -$(SRC_PATH)/scripts/qapi/introspect.py \ -$(SRC_PATH)/scripts/qapi/parser.py \ -$(SRC_PATH)/scripts/qapi/schema.py \ -$(SRC_PATH)/scripts/qapi/source.py \ -$(SRC_PATH)/scripts/qapi/types.py \ -$(SRC_PATH)/scripts/qapi/visit.py \ -$(SRC_PATH)/scripts/qapi-gen.py - -qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h \ -qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h \ -qga/qapi-generated/qga-qapi-commands.h qga/qapi-generated/qga-qapi-command= s.c \ -qga/qapi-generated/qga-qapi-init-commands.h qga/qapi-generated/qga-qapi-in= it-commands.c \ -qga/qapi-generated/qga-qapi-doc.texi: \ -qga/qapi-generated/qapi-gen-timestamp ; -qga/qapi-generated/qapi-gen-timestamp: $(SRC_PATH)/qga/qapi-schema.json $(= qapi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \ - -o qga/qapi-generated -p "qga-" $<, \ - "GEN","$(@:%-timestamp=3D%)") - @>$@ - -QGALIB_GEN=3D$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-vi= sit.h qga-qapi-commands.h qga-qapi-init-commands.h) -$(qga-obj-y): $(QGALIB_GEN) - -qemu-ga$(EXESUF): $(qga-obj-y) $(COMMON_LDADDS) - $(call LINK, $^) - ifdef QEMU_GA_MSI_ENABLED QEMU_GA_MSI=3Dqemu-ga-$(ARCH).msi =20 msi: $(QEMU_GA_MSI) =20 -$(QEMU_GA_MSI): qemu-ga.exe $(QGA_VSS_PROVIDER) +$(QEMU_GA_MSI): qga/qemu-ga.exe $(QGA_VSS_PROVIDER) =20 $(QEMU_GA_MSI): config-host.mak =20 @@ -498,8 +460,8 @@ msi: endif =20 ifneq ($(EXESUF),) -.PHONY: qemu-ga -qemu-ga: qemu-ga$(EXESUF) $(QGA_VSS_PROVIDER) $(QEMU_GA_MSI) +.PHONY: qga/qemu-ga +qga/qemu-ga: qga/qemu-ga$(EXESUF) $(QGA_VSS_PROVIDER) $(QEMU_GA_MSI) endif =20 module_block.h: $(SRC_PATH)/scripts/modules/module_block.py config-host.mak @@ -524,9 +486,6 @@ clean: recurse-clean ninja-clean clean-ctlist rm -f qemu-img-cmds.h rm -f ui/shader/*-vert.h ui/shader/*-frag.h rm -f $(foreach f,$(generated-files-y),$(f) $(f)-timestamp) - rm -f qapi-gen-timestamp - rm -f storage-daemon/qapi/qapi-gen-timestamp - rm -rf qga/qapi-generated rm -f config-all-devices.mak rm -f $(SUBDIR_DEVICES_MAK) =20 @@ -648,7 +607,7 @@ endif ifdef CONFIG_TRACE_SYSTEMTAP $(INSTALL_DATA) $(MANUAL_BUILDDIR)/tools/qemu-trace-stap.1 "$(DESTDIR)$(m= andir)/man1" endif -ifneq (,$(findstring qemu-ga,$(TOOLS))) +ifeq ($(CONFIG_GUEST_AGENT),y) $(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-ga.8 "$(DESTDIR)$(mandir)= /man8" $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/interop" $(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)/i= nterop" @@ -669,7 +628,7 @@ install-datadir: =20 install-localstatedir: ifdef CONFIG_POSIX -ifneq (,$(findstring qemu-ga,$(TOOLS))) +ifeq ($(CONFIG_GUEST_AGENT),y) $(INSTALL_DIR) "$(DESTDIR)$(qemu_localstatedir)"/run endif endif @@ -861,7 +820,7 @@ $(MANUAL_BUILDDIR)/index.html: $(SRC_PATH)/docs/index.h= tml.in qemu-version.h docs/interop/qemu-qmp-qapi.texi: qapi/qapi-doc.texi @cp -p $< $@ =20 -docs/interop/qemu-ga-qapi.texi: qga/qapi-generated/qga-qapi-doc.texi +docs/interop/qemu-ga-qapi.texi: qga/qga-qapi-doc.texi @cp -p $< $@ =20 html: docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html sphinxd= ocs diff --git a/Makefile.objs b/Makefile.objs index 1486254a2c..259f9936ac 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -98,5 +98,4 @@ version-obj-$(CONFIG_WIN32) +=3D $(BUILD_DIR)/version.o # FIXME: a few definitions from qapi/qapi-types.o and # qapi/qapi-visit.o are needed by libqemuutil.a. These should be # extracted into a QAPI schema module, or perhaps a separate schema. -qga-obj-y =3D qga/ qga-vss-dll-obj-y =3D qga/ diff --git a/configure b/configure index 789569279c..123b5632b7 100755 --- a/configure +++ b/configure @@ -825,8 +825,6 @@ FreeBSD) audio_possible_drivers=3D"oss sdl pa" # needed for kinfo_getvmmap(3) in libutil.h LIBS=3D"-lutil $LIBS" - # needed for kinfo_getproc - libs_qga=3D"-lutil $libs_qga" netmap=3D"" # enable netmap autodetect HOST_VARIANT_DIR=3D"freebsd" ;; @@ -888,7 +886,6 @@ SunOS) QEMU_CFLAGS=3D"-D__EXTENSIONS__ $QEMU_CFLAGS" solarisnetlibs=3D"-lsocket -lnsl -lresolv" LIBS=3D"$solarisnetlibs $LIBS" - libs_qga=3D"$solarisnetlibs $libs_qga" ;; Haiku) haiku=3D"yes" @@ -3972,7 +3969,6 @@ for i in $glib_modules; do glib_libs=3D$($pkg_config --libs $i) QEMU_CFLAGS=3D"$glib_cflags $QEMU_CFLAGS" LIBS=3D"$glib_libs $LIBS" - libs_qga=3D"$glib_libs $libs_qga" else error_exit "glib-$glib_req_ver $i is required to compile QEMU" fi @@ -4183,7 +4179,6 @@ else done if test "$found" =3D "no"; then LIBS=3D"$pthread_lib $LIBS" - libs_qga=3D"$pthread_lib $libs_qga" fi PTHREAD_LIB=3D"$pthread_lib" break @@ -5192,7 +5187,6 @@ if compile_prog "" "" ; then : elif compile_prog "" "-lm" ; then LIBS=3D"-lm $LIBS" - libs_qga=3D"-lm $libs_qga" else error_exit "libm check failed" fi @@ -5217,7 +5211,6 @@ if compile_prog "" "" ; then # we need pthread for static linking. use previous pthread test result elif compile_prog "" "$pthread_lib -lrt" ; then LIBS=3D"$LIBS -lrt" - libs_qga=3D"$libs_qga -lrt" fi =20 # Check whether we need to link libutil for openpty() @@ -5596,7 +5589,6 @@ EOF fi =20 LIBS=3D"$lttng_ust_libs $urcu_bp_libs $LIBS" - libs_qga=3D"$lttng_ust_libs $urcu_bp_libs $libs_qga" else error_exit "Trace backend 'ust' missing lttng-ust header files" fi @@ -6722,7 +6714,6 @@ if [ "$guest_agent" !=3D "no" ]; then if [ "$softmmu" =3D no -a "$want_tools" =3D no ] ; then guest_agent=3Dno elif [ "$linux" =3D "yes" -o "$bsd" =3D "yes" -o "$solaris" =3D "yes" -o= "$mingw32" =3D "yes" ] ; then - tools=3D"qemu-ga\$(EXESUF) $tools" guest_agent=3Dyes elif [ "$guest_agent" !=3D yes ]; then guest_agent=3Dno @@ -6968,6 +6959,9 @@ fi if test "$want_tools" =3D "yes" ; then echo "CONFIG_TOOLS=3Dy" >> $config_host_mak fi +if test "$guest_agent" =3D "yes" ; then + echo "CONFIG_GUEST_AGENT=3Dy" >> $config_host_mak +fi if test "$slirp" !=3D "no"; then echo "CONFIG_SLIRP=3Dy" >> $config_host_mak echo "CONFIG_SMBD_COMMAND=3D\"$smbd\"" >> $config_host_mak @@ -7825,7 +7819,7 @@ echo "PTHREAD_LIB=3D$PTHREAD_LIB" >> $config_host_mak echo "EXESUF=3D$EXESUF" >> $config_host_mak echo "DSOSUF=3D$DSOSUF" >> $config_host_mak echo "LDFLAGS_SHARED=3D$LDFLAGS_SHARED" >> $config_host_mak -echo "LIBS_QGA+=3D$libs_qga" >> $config_host_mak +echo "LIBS_QGA=3D$libs_qga" >> $config_host_mak echo "TASN1_LIBS=3D$tasn1_libs" >> $config_host_mak echo "TASN1_CFLAGS=3D$tasn1_cflags" >> $config_host_mak echo "POD2MAN=3D$POD2MAN" >> $config_host_mak diff --git a/meson.build b/meson.build index 2d23c01753..0ff50108d8 100644 --- a/meson.build +++ b/meson.build @@ -128,6 +128,10 @@ if 'CONFIG_CURL' in config_host curl =3D declare_dependency(compile_args: config_host['CURL_CFLAGS'].spl= it(), link_args: config_host['CURL_LIBS'].split()) endif +libudev =3D not_found +if 'CONFIG_LIBUDEV' in config_host + libudev =3D declare_dependency(link_args: config_host['LIBUDEV_LIBS'].sp= lit()) +endif =20 target_dirs =3D config_host['TARGET_DIRS'].split() have_user =3D false @@ -290,6 +294,10 @@ qemuutil =3D declare_dependency(link_with: libqemuutil, =20 # Other build targets =20 +if 'CONFIG_GUEST_AGENT' in config_host + subdir('qga') +endif + if have_tools subdir('contrib/rdmacm-mux') subdir('contrib/elf2dmp') diff --git a/qga/Makefile.objs b/qga/Makefile.objs index 9c558ae51c..9ecf2496da 100644 --- a/qga/Makefile.objs +++ b/qga/Makefile.objs @@ -1,10 +1 @@ -commands-posix.o-libs :=3D $(LIBUDEV_LIBS) -qga-obj-y =3D commands.o guest-agent-command-state.o main.o -qga-obj-$(CONFIG_POSIX) +=3D commands-posix.o channel-posix.o -qga-obj-$(CONFIG_WIN32) +=3D commands-win32.o channel-win32.o service-win3= 2.o -qga-obj-$(CONFIG_WIN32) +=3D vss-win32.o -qga-obj-y +=3D qapi-generated/qga-qapi-types.o qapi-generated/qga-qapi-vis= it.o -qga-obj-y +=3D qapi-generated/qga-qapi-commands.o -qga-obj-y +=3D qapi-generated/qga-qapi-init-commands.o - qga-vss-dll-obj-$(CONFIG_QGA_VSS) +=3D vss-win32/ diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs index f6781752e6..9cb4c3d733 100644 --- a/qga/installer/qemu-ga.wxs +++ b/qga/installer/qemu-ga.wxs @@ -66,7 +66,7 @@ - + test_dir, "sock", NULL); cwd =3D g_get_current_dir(); - cmd =3D g_strdup_printf("%s%cqemu-ga -m unix-listen -t %s -p %s %s %s", - cwd, G_DIR_SEPARATOR, + cmd =3D g_strdup_printf("%s%cqga%cqemu-ga -m unix-listen -t %s -p %s %= s %s", + cwd, G_DIR_SEPARATOR, G_DIR_SEPARATOR, fixture->test_dir, path, getenv("QTEST_LOG") ? "-v" : "", extra_arg ?: ""); @@ -699,8 +699,8 @@ static void test_qga_config(gconstpointer data) GKeyFile *kf; =20 cwd =3D g_get_current_dir(); - cmd =3D g_strdup_printf("%s%cqemu-ga -D", - cwd, G_DIR_SEPARATOR); + cmd =3D g_strdup_printf("%s%cqga%cqemu-ga -D", + cwd, G_DIR_SEPARATOR, G_DIR_SEPARATOR); g_free(cwd); g_shell_parse_argv(cmd, NULL, &argv, &error); g_free(cmd); --=20 2.26.2