From nobody Sun Feb 8 09:37:44 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=1635159487; cv=none; d=zohomail.com; s=zohoarc; b=N7Mr5NO14wTC7qLfQlnSgrNJeuC1P2oGziZvw1GCgLBcOl5nEGT47Gt0EEL7+gGGRW4cbA6tA9cB40m0N1M97qs/n4lnz1Y4GS5/xAmKNqzt+3xcNaotcJNcLg8KiPnKd6+Ia+qbt4/3dDa6g1a6OgCH6xwzXAy+R6E8VXkX2tU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635159487; 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=fWen/VjASsFnx33sTTQjIOYmkoBffx25N12Su6dDptg=; b=XqPMTbjk4kavcqlPAuBaaZyGOulUnozjFPqzGr52ANrinW9Is3ocToqGWm50f7LEH0b2i5poHlARATFlh7usv9JwdPwHRh+JTRKIwq2ShbiZ6g6wzycDhLkCHbM2kZRKg6bEbYb1dO4SCUE0hVOj/tCFvH3ZcnFyVJAb6QCC448= 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 1635159487715486.72741416825124; Mon, 25 Oct 2021 03:58:07 -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-421-CzDjKuBfN-SlmGVkgW1-BQ-1; Mon, 25 Oct 2021 06:58:03 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 10379A0CB0; Mon, 25 Oct 2021 10:57:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E5C8C70871; Mon, 25 Oct 2021 10:57:56 +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 B23FD4E58E; Mon, 25 Oct 2021 10:57:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 19PAvqHG016861 for ; Mon, 25 Oct 2021 06:57:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 08D525DAA5; Mon, 25 Oct 2021 10:57:52 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84FB75DD68 for ; Mon, 25 Oct 2021 10:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635159486; 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=fWen/VjASsFnx33sTTQjIOYmkoBffx25N12Su6dDptg=; b=dWPshO07QhdxOWYTY1lwZMKJmn+HgYcJPSB0tjG9iZ4ziovfr66/0oy1u4S0pTG3tGDglT 821x2szP6jINH/JVEe1gz+tgc77+Gt/mzXhlornanh1EXLTsLMHafTOsHbTYTPxRoAU2X5 Y84cx2bvWtjA/rBQjAqdYJok2i9fows= X-MC-Unique: CzDjKuBfN-SlmGVkgW1-BQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 04/13] qemuMonitorJSONGetMigrationStats: Don't clear @stats on failure Date: Mon, 25 Oct 2021 12:57:28 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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.13 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: 1635159489877100003 Content-Type: text/plain; charset="utf-8" In the qemuMonitorJSONGetMigrationStats() there's a code under cleanup label that's clearing returned @stats if the function returns with an error. However, transitively there's just one caller - qemuMigrationAnyFetchStats() - and it doesn't care for this behaviour. Drop the code to simplify the cleanup label. Signed-off-by: Michal Privoznik --- src/qemu/qemu_monitor_json.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 7833038a06..bcbb4e59ab 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -3542,8 +3542,6 @@ int qemuMonitorJSONGetMigrationStats(qemuMonitor *mon, =20 ret =3D 0; cleanup: - if (ret < 0) - memset(stats, 0, sizeof(*stats)); virJSONValueFree(cmd); virJSONValueFree(reply); return ret; --=20 2.32.0