From patchwork Wed Mar 17 03:22:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 12144633 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9EFFC433E0 for ; Wed, 17 Mar 2021 03:23:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3345164F01 for ; Wed, 17 Mar 2021 03:23:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3345164F01 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMMms-0006Yu-6o for qemu-devel@archiver.kernel.org; Tue, 16 Mar 2021 23:23:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMMlh-0005K3-CE for qemu-devel@nongnu.org; Tue, 16 Mar 2021 23:22:46 -0400 Received: from mail-eopbgr750053.outbound.protection.outlook.com ([40.107.75.53]:4470 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMMle-00011A-0E for qemu-devel@nongnu.org; Tue, 16 Mar 2021 23:22:45 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f93MATt+KNWfdxyPFq6C7E8PX5oD1gk1dfdt3sS9VtsxwG0jrkAJPhkQgSpCSkRYJ7p5EusEHPGo8ixCXr/Mio1S4JbvAsEVtEGQMWe2fDRxYurB14aELekx8iiscc4V96wzqWSups1L22q0OM0hBgOQM3e9Ao9IeBTeJXLBc7MgKpf3JbuFtDCY0mRTmmbSC2+Fg2L7/H7oc97DPxfhFlty+v3HKb6yvWwQcKHVbTVwaBp48HwmUNVxkUHo/ovHBZ92qjs/Uku7PDYxh/FudeoNdCynQqb/LbuqinM17wY2a2tklYqm89Kpvzj89Cf53t7OF/Re2TQ4APP03BPmQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=92jsJvuv8ElMBGIt++Co99O6cmWilu72GoEOAarhtRM=; b=J6eL8WVhnfBwudr5aS1Cv64fhNuJpz3XPmi8eoW5s/D0+yI+MYQVhRtkISMnQN6kLMitERF3vnWBIoKXZaWw4YS5JTEegDv9Z8ewF4QQ0I/bDkbCqsz8kKXAjbq/g4M1wNOCK8c+b6r+FK1ICenexu++k60hT61gimko4O6leZAMSm/YM6bn47nRtFTXc1PJ88pEiiTF8N4ppdfj9tf4hqKQFG3xbEUUj84tO+CzRjPNy0wl6skOUA7MgI9lO/oF/AyOMwkysuKwOv+vkpIs8VMTWdLGGNKRl0oWkD0DQVHUn/7PIUmxMJFPnQYnho7R8nmwvMhca7uYj/JycK9wfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=92jsJvuv8ElMBGIt++Co99O6cmWilu72GoEOAarhtRM=; b=bS2MdvZz6TwKLchCmxfAdcyPSDjFaIIHYgmSlZJbvS5CNHFKlHVrn3IAB1TrXt7GKYepsvOixMLTXqxm4aWD1+2a2nC5+esRPvuEz0sK190cGIfJrsVmIVo5gmeUyu9ZQmoomlx9B4fb9ra2hQeNrRjUS6mFzZ5zw8LYJNYA6j0= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4133.namprd12.prod.outlook.com (2603:10b6:610:7a::13) by CH2PR12MB4954.namprd12.prod.outlook.com (2603:10b6:610:63::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Wed, 17 Mar 2021 03:22:39 +0000 Received: from CH2PR12MB4133.namprd12.prod.outlook.com ([fe80::81f6:605c:f345:b99f]) by CH2PR12MB4133.namprd12.prod.outlook.com ([fe80::81f6:605c:f345:b99f%3]) with mapi id 15.20.3955.018; Wed, 17 Mar 2021 03:22:39 +0000 From: Michael Roth To: qemu-devel@nongnu.org Subject: [PULL for-6.0 2/6] qga: Add spaces around operator Date: Tue, 16 Mar 2021 22:22:13 -0500 Message-Id: <20210317032217.1460684-3-michael.roth@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210317032217.1460684-1-michael.roth@amd.com> References: <20210317032217.1460684-1-michael.roth@amd.com> X-Originating-IP: [165.204.84.11] X-ClientProxiedBy: BN9PR03CA0330.namprd03.prod.outlook.com (2603:10b6:408:112::35) To CH2PR12MB4133.namprd12.prod.outlook.com (2603:10b6:610:7a::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost (165.204.84.11) by BN9PR03CA0330.namprd03.prod.outlook.com (2603:10b6:408:112::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32 via Frontend Transport; Wed, 17 Mar 2021 03:22:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fdab74c3-46ab-478a-3290-08d8e8f3eb22 X-MS-TrafficTypeDiagnostic: CH2PR12MB4954: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:51; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DPEM9e6uPuiHE9oi0jFBKHwObVwcx8LRqSZleqBu+GU6aEmkEuqjuMKOpdfq909G2glyMm+37bso0o+kP2i04uj5tC8rxS/fyLdk30x53kkYci5CgP5KVMPx2SGfhbDXaWFyZNELLrB6gM5YO6jHtnMsGGKBq2LXUUQlnYuohmOAvmPRDJx99rg349ldEvG/Zhn/gSx7MWjohr/XaiD/gSFqzzTsvqI7GyfLvIBc1JCzApKd7dxAVumM1l88qlO6ZcycbnUv6AF3UmS22e6Ll3X6FbD7f36aZ4HOEf7Tuynsdn8Mg4S9XY0c3xYRmr6RNepz2bMsXpregpJ325cIWzUhSS6AC5lrWg8VQb18+sL0WdkmKTBYGA0LA94bVf07AQNvaA5kNHpOFcRb2LgvucMfyB6Gh3ei+Hkn2dtXAFdWXkGa22NosJtBjl32uG+7E0v/CbImh7o6Q4CKCfSmKACl05ThDhAC7az/POZMZkKpkFrJTROoMZUZ8ewlp+xl/zIxed6bjGizrzGjE3W+nt28Pne5jEWikaKqQQgdAP6PgXcYsAdTBtg6oKc4brX5 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4133.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(136003)(39860400002)(346002)(366004)(186003)(8676002)(8936002)(4326008)(478600001)(316002)(26005)(66946007)(54906003)(83380400001)(1076003)(2616005)(66476007)(956004)(66556008)(86362001)(6916009)(36756003)(44832011)(6666004)(6486002)(52116002)(16526019)(6496006)(5660300002)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?h3T/EjTtZSVWUvYtQ0aIhZs9/Xg/qC?= =?utf-8?q?02NUhW2+S6PqjaLagLILhsoCG3BArlt55KvJ5SEwSMKEtQpbFu4wA0FKLNTzXB4m5?= =?utf-8?q?/q0XkQhbSR9jiXEZq/HYVjbEwZ3MTcGS4rsiu7nokVJHvkfR/IHPPOSNgoLlbmTjd?= =?utf-8?q?iCA4fCbX4QmDdZ34dgNn6bb8nDkMr6+kPUB7EgADcIA+nz+jtQPWsGxW4diURr6/w?= =?utf-8?q?O8/K7gF2HXu6CflqaaP3quhMYcM0jORwIvTxgt4jsjVkPfzVnICFyOLU0pip8OGZQ?= =?utf-8?q?wqwWAUfVsOP3jdgw3SLQ1t14fMa3XlCBhGe2pKSuQr8ycIeI0PAZ4Un9qEQRoNFp6?= =?utf-8?q?luEHeUhoIBIQpT0f2ODhisr2DDQd77d7pLmqy8sqHqkXxEQ8DEdCOwn9rb3TqvrJl?= =?utf-8?q?/ZwQk6kKp3oUMTlmiiyYtku5C4N/JkSzZde/LYWy1p9yuTDqdstDnjz7fBuAfAetn?= =?utf-8?q?Xrt7bWN75pUJLyJ4P/B2wK1PiSzTdZ/42t5b8vmlyOuiZeqjdKVPWnDKTvgd5ztSr?= =?utf-8?q?vriFMPEei5nKOEBK9szioOSR6Q6k7ylOAG4vavt8EuVTfLMwc4YAu54jAM6R46IAZ?= =?utf-8?q?NVPMieBozjDOnq2fAb6fZ/2WfK5+iHyTK49xudnVVoZotziwnOz5WrdtlsZe9yxoM?= =?utf-8?q?6urnGmpKKZuhkFeUB4sXdb4B7C83EEg2xUKr+MOYD4PT80Za0BkS285a1jzxe369f?= =?utf-8?q?87MIEF7yCY3xCl3IWfEiOGcFJ+e7DJ119XoT+AbK52FtD1bsW9khqd3IEGtmavGYr?= =?utf-8?q?hB1FlNP31Wu/HxvMJX5RrnTQGZOGmnp6wTnsJC9FtvDaaZ7MZJYzrfAgERZi0MRU1?= =?utf-8?q?gdVyh1nsjBVjvvN6v1iRAEDE7cm5g1CpJxGPDDzJEfDnaoTxYFD2IzBsBV5xgtPnd?= =?utf-8?q?5cnF7kZ4cROuI2/pBqQ5KayaOCIdqm4AsHi89i7MbG51xzFJCu6/Wy0EvJTwB9AsD?= =?utf-8?q?4QRx8uVZnTU5G6qRRZhGw+4KKZS3eMbOC0r8j3GA5v3CibxS9ruVh3YCBO2ZvdOwb?= =?utf-8?q?7+v5ARELgtFKpsQec5Q5wdQJDHd5Pli7ZAPrhmb2F7JWzecBZSZEEHVtvR1KqQC8z?= =?utf-8?q?OzOBs9tUz3vEyZ1I2Odl68MjQ39OQyfeoQV0bw3bSwW9pZSFP+vXEE8tiGTpWzFrd?= =?utf-8?q?b81uXTMdD9BffkpXXcFEbd9uCL3uBg7OZg6XysFOn1ch8qV4wg1hM/8bZeuGu4tL4?= =?utf-8?q?grxrjGe3ASzXdx/6C7BSY/UVxPm+20OweTP9bGT1kl50l0s0Sw0Sj6jIbqif8Z2/U?= =?utf-8?q?SNlncsoZHHdSZl?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: fdab74c3-46ab-478a-3290-08d8e8f3eb22 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4133.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2021 03:22:39.4888 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qWo/0ZILlf8hhERfwWb0sABxvVI3uNOa0mwUcLsYm1UIOuIw7VcAyP84j9LKMH0hHQKtzSU3L2RCFYTzlYynAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4954 Received-SPF: softfail client-ip=40.107.75.53; envelope-from=Michael.Roth@amd.com; helo=NAM02-BL2-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-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: AlexChen , peter.maydell@linaro.org, =?utf-8?q?Mar?= =?utf-8?q?c-Andr=C3=A9_Lureau?= , Euler Robot Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: AlexChen Reported-by: Euler Robot Signed-off-by: AlexChen Reviewed-by: Marc-André Lureau *fix 80+ char violation while we're here *fix w32 build breakage from changing INVALID_SET_FILE_POINTER definition from a cast to a subtraction Signed-off-by: Michael Roth --- qga/channel-win32.c | 7 ++++--- qga/commands-posix.c | 4 ++-- qga/commands-win32.c | 22 +++++++++++----------- qga/commands.c | 4 ++-- qga/main.c | 4 ++-- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/qga/channel-win32.c b/qga/channel-win32.c index 4f04868a76..779007e39b 100644 --- a/qga/channel-win32.c +++ b/qga/channel-win32.c @@ -292,9 +292,9 @@ static gboolean ga_channel_open(GAChannel *c, GAChannelMethod method, return false; } - if (method == GA_CHANNEL_ISA_SERIAL){ + if (method == GA_CHANNEL_ISA_SERIAL) { snprintf(newpath, sizeof(newpath), "\\\\.\\%s", path); - }else { + } else { g_strlcpy(newpath, path, sizeof(newpath)); } @@ -307,7 +307,8 @@ static gboolean ga_channel_open(GAChannel *c, GAChannelMethod method, return false; } - if (method == GA_CHANNEL_ISA_SERIAL && !SetCommTimeouts(c->handle,&comTimeOut)) { + if (method == GA_CHANNEL_ISA_SERIAL + && !SetCommTimeouts(c->handle, &comTimeOut)) { g_autofree gchar *emsg = g_win32_error_message(GetLastError()); g_critical("error setting timeout for com port: %s", emsg); CloseHandle(c->handle); diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 665735fd09..4299ebd96f 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -110,7 +110,7 @@ void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp) reopen_fd_to_null(2); execle("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0", - "hypervisor initiated shutdown", (char*)NULL, environ); + "hypervisor initiated shutdown", (char *)NULL, environ); _exit(EXIT_FAILURE); } else if (pid < 0) { error_setg_errno(errp, errno, "failed to create child process"); @@ -479,7 +479,7 @@ GuestFileRead *guest_file_read_unsafe(GuestFileHandle *gfh, gfh->state = RW_STATE_NEW; } - buf = g_malloc0(count+1); + buf = g_malloc0(count + 1); read_count = fread(buf, 1, count, fh); if (ferror(fh)) { error_setg_errno(errp, errno, "failed to read file"); diff --git a/qga/commands-win32.c b/qga/commands-win32.c index a00e6cb165..4f4c579a3b 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -110,15 +110,15 @@ static OpenFlags guest_file_open_modes[] = { {"w", GENERIC_WRITE, CREATE_ALWAYS}, {"wb", GENERIC_WRITE, CREATE_ALWAYS}, {"a", FILE_GENERIC_APPEND, OPEN_ALWAYS }, - {"r+", GENERIC_WRITE|GENERIC_READ, OPEN_EXISTING}, - {"rb+", GENERIC_WRITE|GENERIC_READ, OPEN_EXISTING}, - {"r+b", GENERIC_WRITE|GENERIC_READ, OPEN_EXISTING}, - {"w+", GENERIC_WRITE|GENERIC_READ, CREATE_ALWAYS}, - {"wb+", GENERIC_WRITE|GENERIC_READ, CREATE_ALWAYS}, - {"w+b", GENERIC_WRITE|GENERIC_READ, CREATE_ALWAYS}, - {"a+", FILE_GENERIC_APPEND|GENERIC_READ, OPEN_ALWAYS }, - {"ab+", FILE_GENERIC_APPEND|GENERIC_READ, OPEN_ALWAYS }, - {"a+b", FILE_GENERIC_APPEND|GENERIC_READ, OPEN_ALWAYS } + {"r+", GENERIC_WRITE | GENERIC_READ, OPEN_EXISTING}, + {"rb+", GENERIC_WRITE | GENERIC_READ, OPEN_EXISTING}, + {"r+b", GENERIC_WRITE | GENERIC_READ, OPEN_EXISTING}, + {"w+", GENERIC_WRITE | GENERIC_READ, CREATE_ALWAYS}, + {"wb+", GENERIC_WRITE | GENERIC_READ, CREATE_ALWAYS}, + {"w+b", GENERIC_WRITE | GENERIC_READ, CREATE_ALWAYS}, + {"a+", FILE_GENERIC_APPEND | GENERIC_READ, OPEN_ALWAYS }, + {"ab+", FILE_GENERIC_APPEND | GENERIC_READ, OPEN_ALWAYS }, + {"a+b", FILE_GENERIC_APPEND | GENERIC_READ, OPEN_ALWAYS } }; #define debug_error(msg) do { \ @@ -280,7 +280,7 @@ static void acquire_privilege(const char *name, Error **errp) Error *local_err = NULL; if (OpenProcessToken(GetCurrentProcess(), - TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, &token)) + TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token)) { if (!LookupPrivilegeValue(NULL, name, &priv.Privileges[0].Luid)) { error_setg(&local_err, QERR_QGA_COMMAND_FAILED, @@ -1116,7 +1116,7 @@ static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp) len = strlen(mnt_point); mnt_point[len] = '\\'; - mnt_point[len+1] = 0; + mnt_point[len + 1] = 0; if (!GetVolumeInformationByHandleW(hLocalDiskHandle, vol_info, sizeof(vol_info), NULL, NULL, NULL, diff --git a/qga/commands.c b/qga/commands.c index e866fc7081..a6491d2cf8 100644 --- a/qga/commands.c +++ b/qga/commands.c @@ -22,9 +22,9 @@ #include "commands-common.h" /* Maximum captured guest-exec out_data/err_data - 16MB */ -#define GUEST_EXEC_MAX_OUTPUT (16*1024*1024) +#define GUEST_EXEC_MAX_OUTPUT (16 * 1024 * 1024) /* Allocation and I/O buffer for reading guest-exec out_data/err_data - 4KB */ -#define GUEST_EXEC_IO_SIZE (4*1024) +#define GUEST_EXEC_IO_SIZE (4 * 1024) /* * Maximum file size to read - 48MB * diff --git a/qga/main.c b/qga/main.c index e7f8f3b161..560490467b 100644 --- a/qga/main.c +++ b/qga/main.c @@ -586,7 +586,7 @@ end: static gboolean channel_event_cb(GIOCondition condition, gpointer data) { GAState *s = data; - gchar buf[QGA_READ_COUNT_DEFAULT+1]; + gchar buf[QGA_READ_COUNT_DEFAULT + 1]; gsize count; GIOStatus status = ga_channel_read(s->channel, buf, QGA_READ_COUNT_DEFAULT, &count); switch (status) { @@ -610,7 +610,7 @@ static gboolean channel_event_cb(GIOCondition condition, gpointer data) * host-side chardev. sleep a bit to mitigate this */ if (s->virtio) { - usleep(100*1000); + usleep(100 * 1000); } return true; default: