From nobody Mon Feb 9 10:32:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1637326688; cv=none; d=zohomail.com; s=zohoarc; b=ljQ3PjGv6tRHlAkzNE3eeBsQpiZbx9ZZEHmODNSdgogMWc4OdHsbkG+Twj/lnfTpeF11YCBpeVq8xDj5ugta0zDWfKxqzkNjozWTkzGdTLGq+UdXUGyIP0dbwCTUpf4hP6v4nU9G4TWzsV7Jrd0INdtQrqsQkRMSBDm9UwNfsTg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637326688; h=Content-Type:Content-Transfer-Encoding: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=5FvMSWVPMNEw6/7psxftdzbFDmrgTktdvTYd8JgxljI=; b=EGZoqnlB8ao8r6IG1Ye5+CAk+k4y6jM6lX6U1Md3CS90zXo8jQkIIjEhHdQNsEm2zW8rwdVap9Gar7ra+7hs4a/d1a/dTGbU+qhxdM6Avxn+7KTN3deuT/5Tbmxx1J7/Zys/wCqY/Hq24PKf3vWu9kOo3VnRvFPR2HiVQlaqf9w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1637326688496313.68806325407513; Fri, 19 Nov 2021 04:58:08 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-571-e_2Q8RY4MYiQlTCYnWi4ZA-1; Fri, 19 Nov 2021 07:58:06 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6861D1006AA1; Fri, 19 Nov 2021 12:58:00 +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 44C385C1D5; Fri, 19 Nov 2021 12:58:00 +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 140B01832DD2; Fri, 19 Nov 2021 12:58:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AJCvwOF005448 for ; Fri, 19 Nov 2021 07:57:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id 38FA960C81; Fri, 19 Nov 2021 12:57:58 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 809C960BF1 for ; Fri, 19 Nov 2021 12:57:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637326687; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=5FvMSWVPMNEw6/7psxftdzbFDmrgTktdvTYd8JgxljI=; b=UnzRVWH5k5QhuJoLQPZmizG0JniiNotACQ6vBcyZaEjC5MN4yawWQI+DjOwMLFqjLhtxr4 ykvczSwW7AbLGumslyAYq11dwf4xE0/tqkjPHoRM5OQxWvqydOVX7dgYpJU71fRGpMorVQ ymtuH/eWXEg/NjNTT4KVRL3SZA0SvAQ= X-MC-Unique: e_2Q8RY4MYiQlTCYnWi4ZA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH v2 2/3] qemuMonitorJSONBuildChrChardevReconnect: Unify with qemuBuildChrChardevReconnectStr Date: Fri, 19 Nov 2021 13:57:43 +0100 Message-Id: <1dc5b4a52281ebe5f8f7c2717bd80782fcdbd717.1637326546.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637326689657100002 Content-Type: text/plain; charset="utf-8" When formatting the commandline we explicitly set the reconnect timeout to 0 when it's disabled even when that's the default. Do the same in the monitor/hotplug code. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 0c66086598..508d56994c 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6602,10 +6602,22 @@ static int qemuMonitorJSONBuildChrChardevReconnect(virJSONValue *object, const virDomainChrSourceReconnectD= ef *def) { - if (def->enabled !=3D VIR_TRISTATE_BOOL_YES) + int timeout =3D 0; + + switch (def->enabled) { + case VIR_TRISTATE_BOOL_ABSENT: + case VIR_TRISTATE_BOOL_LAST: return 0; - return virJSONValueObjectAppendNumberUint(object, "reconnect", def->ti= meout); + case VIR_TRISTATE_BOOL_YES: + timeout =3D def->timeout; + break; + + case VIR_TRISTATE_BOOL_NO: + break; + } + + return virJSONValueObjectAppendNumberUint(object, "reconnect", timeout= ); } static virJSONValue * --=20 2.31.1