From nobody Sun Feb 8 17:22:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1606823436; cv=none; d=zohomail.com; s=zohoarc; b=OVNHcyWMwoHpKAoIZ3+uLM9+b6gJJ2T2KjzbCB9S621i6szhHHUEa+4Nr1JYKZxNtZaIWgiaJUjabwJrn61sxJGBu/h1tpuoHfjGN5QJfcjqsfnsHXaCvMMZtgJX1Ho33BpZ7BJl8K9HL46wGuLgZQa59zfREf2vAl4toW7xT3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606823436; 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=MGcQcG/LIaxc6UxN95H4vbL0D0Q90IG4BjlwFH6VNY4=; b=AB68OhDS9tYNEK62ZkWCoQT9hH3zD1TJ8p1MF+Lpk3w8SpEA1cao3+LQXi7X8Fd3S/UBbWXOX0Lfx/xma2j/FKe7qGE1GKMC1Rn1ZQMCF6XXp2GyiFjfbFYXLN1ZoYUA/C801SaaS0ceNqhX2osD4OTgXCavVWxenPFSAkoMc+Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1606823436287671.8097957081592; Tue, 1 Dec 2020 03:50:36 -0800 (PST) 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-478-jraSQ5gjN7yQ3qsdlb886A-1; Tue, 01 Dec 2020 06:50:33 -0500 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 1D7F11005E55; Tue, 1 Dec 2020 11:50:27 +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 99B2319D7C; Tue, 1 Dec 2020 11:50:26 +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 EEB901809C9F; Tue, 1 Dec 2020 11:50:23 +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 0B1BoMKN026321 for ; Tue, 1 Dec 2020 06:50:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 725335D72E; Tue, 1 Dec 2020 11:50:22 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id E83505D720 for ; Tue, 1 Dec 2020 11:50:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606823435; 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=MGcQcG/LIaxc6UxN95H4vbL0D0Q90IG4BjlwFH6VNY4=; b=eRNd3hRSiT3F20NcX/9HFfdkwV04/nnDN5L3TxeSz3LlPJo45UG1FhuhYyV8yBJq+JBrzt WyKr/Oi5j+Bu0vEnug/YTA7vLotPJARrSK0KbfqRavDUp83Xrv4iIuMl6vtZkle8QBwnmA vl3SuH1xp36NwjJsFoTT+BXIS+i1NGs= X-MC-Unique: jraSQ5gjN7yQ3qsdlb886A-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/3] qemuDomainGetGuestInfo: Exit early if getting info fails Date: Tue, 1 Dec 2020 12:50:14 +0100 Message-Id: <90ec6fa05c49c87e0b5fdb0e315de8dd4a5ccc11.1606823325.git.mprivozn@redhat.com> In-Reply-To: References: 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 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) Content-Type: text/plain; charset="utf-8" If there is an error getting info from guest agent, then the control on qemuDomainGetGuestInfo() jumps onto 'exitagent' label and subsequently continues on 'endagentjob'. Both labels are hit also in success case, which is why there is a code that tries to match info obtained from the guest agent with domain definition. However, if we know that we've reached this area because of an error (ret =3D -1) there is no reason for us to attempt finding the match as the API as whole will end up with an error. Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2d4b5a8b99..338c609854 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20129,6 +20129,9 @@ qemuDomainGetGuestInfo(virDomainPtr dom, endagentjob: qemuDomainObjEndAgentJob(vm); =20 + if (ret < 0) + goto cleanup; + if (nfs > 0 || ndisks > 0) { if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0) goto cleanup; --=20 2.26.2