From nobody Mon Feb 9 16:53:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1584347823; cv=none; d=zohomail.com; s=zohoarc; b=ANsmMj9OOBG2L1Skxe2zP9AkJLM0hpg00iueUYG1CC9f316SB7LJAG4vsDnhogoFxXUaQ46Frf7pSBbDf+An2u7d/1i93crFNyWPuPPVhlUnB7PW3fuLjBqm5hAaBDKjm9a7iPb6PB0HVcOr4/H6BBSXdFbhJISUFXBdTIyahHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584347823; 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=dkKl6zcq+L6xOad00U5/mjmLX7EyegpfEBfYNh++B8Q=; b=ZrSVSVOQR7ir+0gyLXTz5y863lHQp3N1cE8uuskM40EHwmnq8aHGZ6oc70UIG0POwBURLzyNIfRTPqf59oAHbvneyCEClGx9i1GWSe6+gcA3L9CdDt94I2qTZaRWgwJQL4umqi0EXeGsSgs6TK28ejhWXdLiNOiC6MqZ++YcNRM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1584347823552611.2035451949046; Mon, 16 Mar 2020 01:37:03 -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-317-c1gfNC3tMVKTTuyIqFUWzg-1; Mon, 16 Mar 2020 04:36:40 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4C47A149C3; Mon, 16 Mar 2020 08:36:34 +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 13C3F60C63; Mon, 16 Mar 2020 08:36:34 +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 BC2061803C33; Mon, 16 Mar 2020 08:36:33 +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 02G8ZxU4026169 for ; Mon, 16 Mar 2020 04:35:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 04D0760BFB; Mon, 16 Mar 2020 08:35:59 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F6C960BF3 for ; Mon, 16 Mar 2020 08:35:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584347822; 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=dkKl6zcq+L6xOad00U5/mjmLX7EyegpfEBfYNh++B8Q=; b=At5N/L4nwqlEPtgt5/ipC+U4tRBpvKeZXW7mwj0FTPpHqStCSM95BL/nl+iRxX04Tn+mv7 NDZpHLkQq346SN2wmk7cqFD6+Hd3n2d+VpjUbPUN4gOEruqg7MtQodpt8TF6ur1rEYDDDU H/ODxM/ylV//DRDjW6FGkKlzGxm0vC8= X-MC-Unique: c1gfNC3tMVKTTuyIqFUWzg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 01/12] qemuDomainGetGuestInfo: don't assign NULL hostname Date: Mon, 16 Mar 2020 09:35:43 +0100 Message-Id: <63d603c189717d9bde7dcaf92f16e91297b4b918.1584347691.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.12 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" Don't rely on error check and assign hostname only when non-NULL. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 641a90d595..241513705d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -22909,14 +22909,14 @@ qemuDomainGetGuestInfo(virDomainPtr dom, } if (supportedTypes & VIR_DOMAIN_GUEST_INFO_HOSTNAME) { rc =3D qemuAgentGetHostname(agent, &hostname); - if (rc < 0 && !(rc =3D=3D -2 && types =3D=3D 0)) { + if (rc < 0 && !(rc =3D=3D -2 && types =3D=3D 0)) goto exitagent; - } else { - if (virTypedParamsAddString(params, nparams, &maxparams, "host= name", - hostname) < 0) - goto exitagent; - } } + + if (hostname && + virTypedParamsAddString(params, nparams, &maxparams, "hostname", h= ostname) < 0) + goto exitagent; + if (supportedTypes & VIR_DOMAIN_GUEST_INFO_FILESYSTEM) { rc =3D qemuAgentGetFSInfo(agent, &agentfsinfo); if (rc < 0) { --=20 2.24.1