From nobody Tue Nov 26 02:29:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1584743479; cv=none; d=zohomail.com; s=zohoarc; b=E5Ew4D0AsS4rrxJswPcpsdgdxWYURbnHBRber4dCZWmC5BsW/DgsVZ9DtSFxHFVVGGrTbd59tvYPR/6qF2byJTF6GrDN62KAygWKVRGeWGOqHh3aySjxBPg+CGgN2UVkVFHexC149h9GwtwPaPETmgXwoDFm8YSsWf/Ru+cK2gw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584743479; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=zigq8I3n5omRPg6rL6dDVBJ4MjzI4b06FCUHMDg8e8E=; b=Mo64rPxLLbHLPrKT95WtbzzlUHQSs+DmitYzUI96xapVkvm6kQRcItHpS0LHkTLo4qza6PHafSFvVP2uxpdDwJZY96/jTBPkuyYTpQv5H6aVyyJ89baZ+uo70bQcD9NPovSYlSrLSujUuyi7TkobFBFHE0lTX/KJ/wWPvOktYyw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1584743479791851.8835651114804; Fri, 20 Mar 2020 15:31:19 -0700 (PDT) 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-374-BqsT-3sMPGuyHWzQIqKV1w-1; Fri, 20 Mar 2020 18:31:16 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A7701107ACCA; Fri, 20 Mar 2020 22:31:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4836A19757; Fri, 20 Mar 2020 22:31:05 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A4C1F1809563; Fri, 20 Mar 2020 22:30:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02KMSENB004759 for ; Fri, 20 Mar 2020 18:28:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 004D15417F; Fri, 20 Mar 2020 22:28:14 +0000 (UTC) Received: from himantopus.redhat.com (ovpn-112-119.phx2.redhat.com [10.3.112.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C23C917B91 for ; Fri, 20 Mar 2020 22:28:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584743478; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=zigq8I3n5omRPg6rL6dDVBJ4MjzI4b06FCUHMDg8e8E=; b=HaFFAnOtccx55TGrdF9T9QYaVbVm6q3JUqqk8KG1g8sMINBR5uslOmcIAm0sbIJPY312yD iDUWJ+bN13oaOUYX3dW99D2duToda8u8526PC7JkrKu1k4UwLw3T/johiuIID/l1pNxR5a TPNOkY+yHchRE6NvkMTATylIbIlVAFs= X-MC-Unique: BqsT-3sMPGuyHWzQIqKV1w-1 From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH] qemu: fix response timeout for agent guest-sync Date: Fri, 20 Mar 2020 17:28:10 -0500 Message-Id: <20200320222810.3288-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The agent 'guest-sync' command historically had a 5s response timeout which was different from other agent commands, which waited forever. When we added the ability to customize the response timeout for guest agent commands, we intended to continue to use 5s for 'guest-sync' when the user specified a response timeout greater than 5s, and use the user-specified timeout if it was below 5s. Unfortunately, when attempting to determine whether the user-specified timeout was less than 5s, we were comparing against an enum value of VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT (which is -1) rather than against the actual time value that it represented (5). This change makes it so that 'guest-sync' now uses the user-specified tiemout if it is less than 5s. Signed-off-by: Jonathon Jongsma Reviewed-by: Daniel Henrique Barboza --- src/qemu/qemu_agent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index 6ff5b11374..a10ef0728a 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -904,7 +904,7 @@ qemuAgentGuestSync(qemuAgentPtr agent) =20 /* if user specified a custom agent timeout that is lower than the * default timeout, use the shorter timeout instead */ - if ((agent->timeout >=3D 0) && (agent->timeout < timeout)) + if ((agent->timeout >=3D 0) && (agent->timeout < QEMU_AGENT_WAIT_TIME)) timeout =3D agent->timeout; =20 memset(&sync_msg, 0, sizeof(sync_msg)); --=20 2.21.1