From nobody Thu May 2 12:27:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1639398671; cv=none; d=zohomail.com; s=zohoarc; b=PdZViOYqDVq1jDyNZCaWKmtUtiSl0G7yP9rc1TxsrtsbHlEUpLfTLXc/DKEnbchm2re7th06vd9iucMI/o/qNQKTdPTDg9AcwbjrtqDqraECTsR05wdu5zR2Ei41KZM/IsftOYlSYx+bDglkI9J6LzmJ24OVpcNno656uzmRT/I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639398671; 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=+r1bdQ5ZhQgSNmty6AZPJSXTvbli4ez/FdNN9H23hp8=; b=TF7gozsIKeQI0ueusMCilW1CmfWqGYdwWlGlRC88A7oTssEUX5LBLh9pKUT1ELTeg4QvFD9+ZkPzeAtyYHpnoGaAzt77lm/fdW7niKDjPPkqnOZT+DePD1sp/EeRDzJTYqfBm8uWGw1XLSttus7b3MDD9AysjicB0ADEByZ7PBo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1639398671564626.9694195281256; Mon, 13 Dec 2021 04:31:11 -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-520-PY2Me2s6ONe83sf2_Din0A-1; Mon, 13 Dec 2021 07:31:07 -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 59F556408E; Mon, 13 Dec 2021 12:31:02 +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 0F71A18032; Mon, 13 Dec 2021 12:31:01 +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 8F5141809CB8; Mon, 13 Dec 2021 12:30:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1BDCUwBW023807 for ; Mon, 13 Dec 2021 07:30:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4326F418E; Mon, 13 Dec 2021 12:30:58 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id B7E0345D8A for ; Mon, 13 Dec 2021 12:30:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639398670; 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=+r1bdQ5ZhQgSNmty6AZPJSXTvbli4ez/FdNN9H23hp8=; b=d2ByAn2JSgBujIenKkCfBtG/M5rBvNmE7Ui3u+ceZTMgQlk7mBVHBPgNE49I3SxRilZdI8 9zrv+06Vg7kT0aAiEh9eNjOlv4pWPJiE0lUpeaM7tXzLnTPn96le08raOkP+0pY/biKktz O7wh2kdn6tjKA3LzJetPZVXX4QOS220= X-MC-Unique: PY2Me2s6ONe83sf2_Din0A-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH] qemu: qemuBuildChardevCommand: use chrSourcePriv unconditionally Date: Mon, 13 Dec 2021 13:30:28 +0100 Message-Id: <77b8f188ac52b160f0a455516d8db03c3259a7a9.1639398617.git.jtomko@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1639398672473100001 In the QEMU driver, we allocate private source data unconditionally for every chardev and the rest of the function just assumes it's there. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Peter Krempa --- Pointed out by Coverity. src/qemu/qemu_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 613f7a5d2a..0017cf6ca7 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1493,7 +1493,7 @@ qemuBuildChardevCommand(virCommand *cmd, * secinfo is added only to a TCP serial device during * qemuDomainSecretChardevPrepare. Subsequently called * functions can just check the config fields */ - if (chrSourcePriv && chrSourcePriv->secinfo) { + if (chrSourcePriv->secinfo) { if (qemuBuildObjectSecretCommandLine(cmd, chrSourcePriv->secinf= o, qemuCaps) < 0) --=20 2.31.1