From nobody Fri Dec 19 18:47:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1742232550; cv=none; d=zohomail.com; s=zohoarc; b=hClPRCtpiIvdz6+JvW9c2iz74Cey/yj+GvYiyKy3w3M55WQ1U3Z7V04Rgis6CnwyaG6KefuRrLw0pgZn8yyYr7SSRu3qtYOG/EoXjhKR+4hfggXkloRpTmWYhVf8nTtI/bTH/seJAz0trN96sIfjkg0/T+OQWtRBfYeW07nrxrI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742232550; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=iG/A8mn+Kz3kREWvgLiIwgka3zLMZgLXLAh+s8Du2oI=; b=malwtRkOaVPYd4jiT/gWeDSFyAFtVCt8Q3zTUnijkeRw9IgodoGSat/yCmOX6RBO/AhEmFl+kg2UFNJ0QYYRCn5AfQ+6p10bUo/x7atqDejnNSzfdvm6L/d8PwNzIP9J+xnB1tt2d/spAIOKjg9lViLdKQug7i/CAhK9g8yS5I8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1742232550142448.92494031758145; Mon, 17 Mar 2025 10:29:10 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 39187241B; Mon, 17 Mar 2025 13:29:09 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 6603223AD; Mon, 17 Mar 2025 13:27:49 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id D23C62108; Mon, 17 Mar 2025 13:27:42 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 270692108 for ; Mon, 17 Mar 2025 13:27:42 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-292-bWXX1uXPMkWCV4y2Lbvl1A-1; Mon, 17 Mar 2025 13:27:40 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 86EFF180AF50 for ; Mon, 17 Mar 2025 17:27:39 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.6]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B65231828A80 for ; Mon, 17 Mar 2025 17:27:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742232461; h=from:from: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; bh=Aq/1uTO+5azpN03vrZGccO0BFKKBuKzWDJMzO7isFPs=; b=WnJxxbyMp0QOxarjeFb+bbibN8s01StNyhIdoJJrAirKBtamjjTrtrmJKVQN2Ow4GGON71 a4NMne9obQQiks/xhnG7QImtHC8IAkFF8M11bGXkAYgNgrejgd7XpWw7YuFZNgqZ7CcjKE MpTSueWNpVfKGPfId/sK6RrVr9j+Nno= X-MC-Unique: bWXX1uXPMkWCV4y2Lbvl1A-1 X-Mimecast-MFC-AGG-ID: bWXX1uXPMkWCV4y2Lbvl1A_1742232459 To: devel@lists.libvirt.org Subject: [PATCH 3/5] qemu: Remove return value from 'qemuHotplugRemoveManagedPR' Date: Mon, 17 Mar 2025 18:27:30 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: FCnYswY6LWwklxWsip22qBn3N8zbL1ZJD1tAN12s4xQ_1742232459 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: I4MXUBZ6DQCG4L5BO47WFSVOWBWZVSEE X-Message-ID-Hash: I4MXUBZ6DQCG4L5BO47WFSVOWBWZVSEE X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742232552720019100 Content-Type: text/plain; charset="utf-8" From: Peter Krempa The only place which actually checked the return value would skip code e.g. to delete unused files or stop no longer used services. The rest of the callers ignored the value. As this is expected to be used on cleanup code paths which have no possibility to report errors we should remove the return value completely. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 2 +- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_hotplug.c | 17 +++++++---------- src/qemu/qemu_hotplug.h | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 7b7d54fdca..c1b29f2fde 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -709,7 +709,7 @@ qemuBlockJobEventProcessConcludedRemoveChain(virQEMUDri= ver *driver, qemuDomainStorageSourceChainAccessRevoke(driver, vm, chain); - ignore_value(qemuHotplugRemoveManagedPR(vm, asyncJob)); + qemuHotplugRemoveManagedPR(vm, asyncJob); } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index cf7069a34a..37cd3a8b7b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14396,7 +14396,7 @@ qemuDomainBlockCopyCommon(virDomainObj *vm, if (need_revoke) qemuDomainStorageSourceChainAccessRevoke(driver, vm, mirror); - ignore_value(qemuHotplugRemoveManagedPR(vm, VIR_ASYNC_JOB_NONE)); + qemuHotplugRemoveManagedPR(vm, VIR_ASYNC_JOB_NONE); } if (need_unlink && virStorageSourceUnlink(mirror) < 0) VIR_WARN("%s", _("unable to remove just-created copy target")); diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index b6ef10edf9..bb599d1505 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -469,31 +469,29 @@ qemuHotplugAttachManagedPR(virDomainObj *vm, * Removes the managed PR object from @vm if the configuration does not re= quire * it any more. */ -int +void qemuHotplugRemoveManagedPR(virDomainObj *vm, virDomainAsyncJob asyncJob) { qemuDomainObjPrivate *priv =3D vm->privateData; virErrorPtr orig_err; - int ret =3D -1; if (qemuDomainDefHasManagedPR(vm)) - return 0; + return; virErrorPreserveLast(&orig_err); if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0) goto cleanup; + ignore_value(qemuMonitorDelObject(priv->mon, qemuDomainGetManagedPRAli= as(), false)); qemuDomainObjExitMonitor(vm); qemuProcessKillManagedPRDaemon(vm); - ret =3D 0; cleanup: virErrorRestore(&orig_err); - return ret; } @@ -665,7 +663,7 @@ qemuDomainChangeEjectableMedia(virQEMUDriver *driver, /* remove PR manager object if unneeded */ if (managedpr) - ignore_value(qemuHotplugRemoveManagedPR(vm, VIR_ASYNC_JOB_NONE)); + qemuHotplugRemoveManagedPR(vm, VIR_ASYNC_JOB_NONE); /* revert old image do the disk definition */ if (oldsrc) @@ -1099,7 +1097,7 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver = *driver, ignore_value(qemuDomainStorageSourceChainAccessRevoke(driver, = vm, disk->src)); if (virStorageSourceChainHasManagedPR(disk->src)) - ignore_value(qemuHotplugRemoveManagedPR(vm, VIR_ASYNC_JOB_NONE= )); + qemuHotplugRemoveManagedPR(vm, VIR_ASYNC_JOB_NONE); } qemuDomainSecretDiskDestroy(disk); qemuDomainCleanupStorageSourceFD(disk->src); @@ -4739,9 +4737,8 @@ qemuDomainRemoveDiskDevice(virQEMUDriver *driver, if (diskBackend) qemuDomainStorageSourceChainAccessRevoke(driver, vm, disk->src); - if (virStorageSourceChainHasManagedPR(disk->src) && - qemuHotplugRemoveManagedPR(vm, VIR_ASYNC_JOB_NONE) < 0) - goto cleanup; + if (virStorageSourceChainHasManagedPR(disk->src)) + qemuHotplugRemoveManagedPR(vm, VIR_ASYNC_JOB_NONE); qemuNbdkitStopStorageSource(disk->src, vm, true); diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h index d51f649bac..6a94dbd0cb 100644 --- a/src/qemu/qemu_hotplug.h +++ b/src/qemu/qemu_hotplug.h @@ -130,6 +130,6 @@ int qemuHotplugAttachManagedPR(virDomainObj *vm, virStorageSource *src, virDomainAsyncJob asyncJob); -int +void qemuHotplugRemoveManagedPR(virDomainObj *vm, virDomainAsyncJob asyncJob); --=20 2.48.1