From nobody Fri Dec 19 15:46:36 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502640061897394.83600211941257; Sun, 13 Aug 2017 09:01:01 -0700 (PDT) Received: from localhost ([::1]:35475 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgvK0-0001kd-ME for importer@patchew.org; Sun, 13 Aug 2017 12:01:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgvIA-0000QQ-HU for qemu-devel@nongnu.org; Sun, 13 Aug 2017 11:59:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dgvI6-0003lB-Jh for qemu-devel@nongnu.org; Sun, 13 Aug 2017 11:59:06 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33393) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dgvI6-0003jj-DM for qemu-devel@nongnu.org; Sun, 13 Aug 2017 11:59:02 -0400 Received: by mail-wm0-x244.google.com with SMTP id q189so11935383wmd.0 for ; Sun, 13 Aug 2017 08:59:00 -0700 (PDT) Received: from bark.daynix ([141.226.163.173]) by smtp.gmail.com with ESMTPSA id c68sm3909025wmh.21.2017.08.13.08.58.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Aug 2017 08:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VaUMBz+Les8fQV/f2p8kly7KfUKxbt4a9CDrxuQ/wFk=; b=0tFC1hdJelJhPLqg4CP91COw/lbW8zRbqlikygCkgawLQdiN4Z/LJqWuGGrfDAnsbt WT7tGopyc57ilrL1NEVd2u+2/cMC6O7Cr/nE5Q3vYFYyNUv6eTth3AekuIrpuAu2nH8/ ajIL0x6zcBC0ldc++ny3tUaGfpgySt3sUigK4S4apZRfAmGPHXJ0akPIWQYUqYDKrXov kYLox2u78V8lDa7NPVZrd+yQ9XMzWUVe+ACAuGQnHX1BVcxs8nnr6zwakf97V/G4Ay0F cIMsLTSGHQzFVG/lfEkYk5NJ8aDM171IWvyvWL08oWrtV1wWuTKTPhIoP0hqlbUt0V20 tR8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VaUMBz+Les8fQV/f2p8kly7KfUKxbt4a9CDrxuQ/wFk=; b=Fjhxip43aX8quGSU6fsI2kJQVEjfRJzxYUPU6XFNKqbV9aLO+O/PTtIYBHUYZYS0Hf pdcQyS2QrVYQW3dYFiTZgAO8VMl4E6RBPuwYmAVU1dPPJCDJmsu/7DbHgkrJKEWtFg/s X4RXBwpO2I118OEyPb69+W4U40hebr5NKAeb5nTvc/rsL5+mseYuyOjeGp/oIOw1ajxg irsdOajxLpu6WcvtsGRq+BFEwGgopG5gbXST+MFDe27LRKZTtaoRa9gNWLz7Ox9bSLQm TqMQLC9Mo3pPP7NDEB8bq9iC4UgLe6FP3YLVeUw2S5xbhohfO7TtMdy/MDk37CQjNL90 3Nvg== X-Gm-Message-State: AHYfb5idiRXur+tCwQirZeOVPCqr52EHDQpMADRBOW8TECBxDWoVHuAY 5fiOfoxn5O9mcOJ/aEw= X-Received: by 10.28.30.77 with SMTP id e74mr2580044wme.172.1502639939667; Sun, 13 Aug 2017 08:58:59 -0700 (PDT) From: Sameeh Jubran To: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Date: Sun, 13 Aug 2017 18:58:48 +0300 Message-Id: <20170813155849.11368-3-sameeh@daynix.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170813155849.11368-1-sameeh@daynix.com> References: <20170813155849.11368-1-sameeh@daynix.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH 2/3] qga: main: make qga config and socket activation global X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yan@daynix.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Sameeh Jubran Signed-off-by: Sameeh Jubran --- qga/main.c | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/qga/main.c b/qga/main.c index 1b381d0..cf312b9 100644 --- a/qga/main.c +++ b/qga/main.c @@ -92,7 +92,28 @@ struct GAState { GAPersistentState pstate; }; =20 +typedef struct GAConfig { + char *channel_path; + char *method; + char *log_filepath; + char *pid_filepath; +#ifdef CONFIG_FSFREEZE + char *fsfreeze_hook; +#endif + char *state_dir; +#ifdef _WIN32 + const char *service; +#endif + gchar *bliststr; /* blacklist may point to this string */ + GList *blacklist; + int daemonize; + GLogLevelFlags log_level; + int dumpconf; +} GAConfig; + struct GAState *ga_state; +struct GAConfig *ga_config; +int ga_socket_activation; QmpCommandList ga_commands; =20 /* commands that are safe to issue while filesystems are frozen */ @@ -942,25 +963,6 @@ static GList *split_list(const gchar *str, const gchar= *delim) return list; } =20 -typedef struct GAConfig { - char *channel_path; - char *method; - char *log_filepath; - char *pid_filepath; -#ifdef CONFIG_FSFREEZE - char *fsfreeze_hook; -#endif - char *state_dir; -#ifdef _WIN32 - const char *service; -#endif - gchar *bliststr; /* blacklist may point to this string */ - GList *blacklist; - int daemonize; - GLogLevelFlags log_level; - int dumpconf; -} GAConfig; - static void config_load(GAConfig *config) { GError *gerr =3D NULL; @@ -1353,7 +1355,7 @@ int main(int argc, char **argv) { int ret =3D EXIT_SUCCESS; GAState *s =3D g_new0(GAState, 1); - GAConfig *config =3D g_new0(GAConfig, 1); + GAConfig *config =3D ga_config =3D g_new0(GAConfig, 1); int socket_activation; =20 config->log_level =3D G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL; @@ -1376,7 +1378,7 @@ int main(int argc, char **argv) config->method =3D g_strdup("virtio-serial"); } =20 - socket_activation =3D check_socket_activation(); + ga_socket_activation =3D socket_activation =3D check_socket_activation= (); if (socket_activation > 1) { g_critical("qemu-ga only supports listening on one socket"); ret =3D EXIT_FAILURE; --=20 2.9.4