From nobody Sun Feb 8 23:05:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1575644880; cv=none; d=zohomail.com; s=zohoarc; b=CLXvBBuXMadrfTOCkifmH8QTdemjQaDtigACRDvGNBBDpmuoeT4D6AujVA4ziSxRn87FfLTW3JjGC6xVDnkJE7PHJOGO0fYDYtO/Tibx6r0C3wvI1vlM0ufqMfLC08MmQSW5Xz8hWy3yC3pp+94AY+RWEih7pblA5Q40cRT8ZcI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575644880; 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=NpBGgGOqSrg+0NOpMLS0lUflkD2Jb9Myu63VIfJPQVA=; b=YSLLsyNVJYNhqHNyIHfJfMNMTPN9Ow42lfbZzW+mjZQHFTF9hb1ZXQQla4jFW1jj53sXwTXBpCBAMFVue1NGyujVHGB5gfanAqzabt1LqYCr9bnAvuPdLV5Zy/sUA2zHCBl9z8gBLbQTjmzUYCJt+7fNNMFLpTe3EVXvB1hvGa4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1575644880680846.6259383715663; Fri, 6 Dec 2019 07:08:00 -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-101-eYeV9t-OO-6xmq5Z7VbZ6Q-1; Fri, 06 Dec 2019 10:07:57 -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 C3FF2DBA6; Fri, 6 Dec 2019 15:07:51 +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 9C2E65C1C3; Fri, 6 Dec 2019 15:07:51 +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 14AD66B5C6; Fri, 6 Dec 2019 15:07:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB6F7n7n019318 for ; Fri, 6 Dec 2019 10:07:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id E811367E52; Fri, 6 Dec 2019 15:07:49 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6FB3C1CB for ; Fri, 6 Dec 2019 15:07:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575644879; 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=NpBGgGOqSrg+0NOpMLS0lUflkD2Jb9Myu63VIfJPQVA=; b=bzoelu0O77NxStDXQ1V2V0rhTUczVO0fI5tS9FZGhbOtyU/OdUSjU6GvMFnpQSjInFq6et tKMblB8ZfT9tR9wAe/KtBl30a06YwbqYSI34b0uU+mnhZwrLl9NWADRCsovwFheJXZgQq+ 4zD0cM9bZhsrwFhZ8SGeNNFrgsZ8Rfc= From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 6 Dec 2019 16:07:43 +0100 Message-Id: <0917bc0dd8e52b59c530dcf38d1b76a4e7621e24.1575644811.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] qemu: driver: Use qemuDomainDiskByName instead of virDomainDiskByName 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 X-MC-Unique: eYeV9t-OO-6xmq5Z7VbZ6Q-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Where appropriate replace the open coded call with the qemu wrapper which already reports the error. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index bad2fb52f3..82f70465bc 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11880,12 +11880,8 @@ qemuDomainBlockPeek(virDomainPtr dom, if (virDomainBlockPeekEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - /* Check the path belongs to this domain. */ - if (!(disk =3D virDomainDiskByName(vm->def, path, true))) { - virReportError(VIR_ERR_INVALID_ARG, - _("invalid disk or path '%s'"), path); + if (!(disk =3D qemuDomainDiskByName(vm->def, path))) goto cleanup; - } if (disk->src->format !=3D VIR_STORAGE_FILE_RAW) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, @@ -17818,11 +17814,8 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom, if (virDomainObjCheckActive(vm) < 0) goto endjob; - if (!(disk =3D virDomainDiskByName(vm->def, path, true))) { - virReportError(VIR_ERR_INVALID_ARG, - _("disk %s not found in the domain"), path); + if (!(disk =3D qemuDomainDiskByName(vm->def, path))) goto endjob; - } if (!(job =3D qemuBlockJobDiskGetJob(disk))) { ret =3D 0; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list