From nobody Mon Dec 15 23:05:16 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1658846425; cv=none; d=zohomail.com; s=zohoarc; b=nMWRNjpBrQ/CVH4oERvgWzj3ZxN66BKmSfGvuaa7Qu4rztJQHyE25/TnTEl2moTIiOGESZKBBgcF+aDdu+G9trA8iGuQNlFoiG9bMf6fA8nwCEBYsaX9SC/NB3tNrjbdlN+dWNC6RQ52+Mtlyahkzk3/AWUVe4S2MDYUw5Pcs+o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658846425; 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=/kgSpxAqVBESXtEr5960PlIsBPR9AfT/AgUzsV9qL+o=; b=O+jatpsUmZKe3Arj4q9DxcvasgYUCmbqhBUqRwE9ygXSBrIhTQwtCNtQP1nnSOOunNFuSGRi5qArnvLfhGRsXVa9h3kP1f/gmI/JBcUF9fKt1G+wYkrmtkbObM6w8tLpTlWcwrkbG/L9viqwQgL2CzILjMwjzYUSNTY8yIFADDs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1658846425304118.4644029701293; Tue, 26 Jul 2022 07:40:25 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-279-N68cDPQQM7axoux0M3p7Fw-1; Tue, 26 Jul 2022 10:39:30 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2143D824066; Tue, 26 Jul 2022 14:38:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0CB894050C46; Tue, 26 Jul 2022 14:38:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 39DCB1947B8C; Tue, 26 Jul 2022 14:38:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 553791945DBB for ; Tue, 26 Jul 2022 14:38:47 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3E1B740CFD0B; Tue, 26 Jul 2022 14:38:47 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id B393B40CFD0A for ; Tue, 26 Jul 2022 14:38:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658846424; 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=/kgSpxAqVBESXtEr5960PlIsBPR9AfT/AgUzsV9qL+o=; b=MGhGkvE7tQAGKUp09dgLDN0lrT0AOry6AE6jkUafH4WVOLykP/pwINnwLhG2schBzEOMUP nuwMszv8IVYyxF45iYEwhpliN/QSlbT6Uoay1e7OQ+1FEXM/UFJI7cdDy5X6q0yOs4M9+y GnWQZT9xXwE7+jgXFqI8GciEiW1qj5M= X-MC-Unique: N68cDPQQM7axoux0M3p7Fw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 47/80] qemu: monitor: Remove unused qemuMonitorDiskNameLookup Date: Tue, 26 Jul 2022 16:37:25 +0200 Message-Id: <010508d3109ca554a47edc6bb643ced5e8d01505.1658843187.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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: 1658846426385100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_monitor.c | 14 ------- src/qemu/qemu_monitor.h | 5 --- src/qemu/qemu_monitor_json.c | 77 ------------------------------------ src/qemu/qemu_monitor_json.h | 8 ---- 4 files changed, 104 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 15fe6690e9..f7dade5d79 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2929,20 +2929,6 @@ qemuMonitorBlockCommit(qemuMonitor *mon, } -/* Determine the name that qemu is using for tracking the backing - * element TARGET within the chain starting at TOP. */ -char * -qemuMonitorDiskNameLookup(qemuMonitor *mon, - const char *device, - virStorageSource *top, - virStorageSource *target) -{ - QEMU_CHECK_MONITOR_NULL(mon); - - return qemuMonitorJSONDiskNameLookup(mon, device, top, target); -} - - /* Use the block-job-complete monitor command to pivot a block copy job. = */ int qemuMonitorDrivePivot(qemuMonitor *mon, diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 89b2348775..7374192da2 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1002,11 +1002,6 @@ int qemuMonitorBlockCommit(qemuMonitor *mon, const char *backingName, unsigned long long bandwidth) ATTRIBUTE_NONNULL(2); -char *qemuMonitorDiskNameLookup(qemuMonitor *mon, - const char *device, - virStorageSource *top, - virStorageSource *target) - ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); int qemuMonitorArbitraryCommand(qemuMonitor *mon, const char *cmd, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e569cf27be..7b6be69aa7 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4208,83 +4208,6 @@ qemuMonitorJSONBlockCommit(qemuMonitor *mon, return 0; } - -static char * -qemuMonitorJSONDiskNameLookupOne(virJSONValue *image, - virStorageSource *top, - virStorageSource *target) -{ - virJSONValue *backing; - char *ret; - - /* The caller will report a generic message if we return NULL - * without an error; but in some cases we can improve by reporting - * a more specific message. */ - if (!top || !image) - return NULL; - if (top !=3D target) { - backing =3D virJSONValueObjectGetObject(image, "backing-image"); - return qemuMonitorJSONDiskNameLookupOne(backing, top->backingStore, - target); - } - ret =3D g_strdup(virJSONValueObjectGetString(image, "filename")); - /* Sanity check - the name qemu gave us should resolve to the same - file tracked by our target description. */ - if (virStorageSourceIsLocalStorage(target) && - STRNEQ(ret, target->path) && - !virFileLinkPointsTo(ret, target->path)) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("qemu block name '%s' doesn't match expected '%s'= "), - ret, target->path); - VIR_FREE(ret); - } - return ret; -} - - -char * -qemuMonitorJSONDiskNameLookup(qemuMonitor *mon, - const char *device, - virStorageSource *top, - virStorageSource *target) -{ - g_autoptr(virJSONValue) devices =3D NULL; - size_t i; - - if (!(devices =3D qemuMonitorJSONQueryBlock(mon))) - return NULL; - - for (i =3D 0; i < virJSONValueArraySize(devices); i++) { - virJSONValue *dev; - virJSONValue *inserted; - virJSONValue *image; - const char *thisdev; - - if (!(dev =3D qemuMonitorJSONGetBlockDev(devices, i))) - return NULL; - - if (!(thisdev =3D qemuMonitorJSONGetBlockDevDevice(dev))) - return NULL; - - if (STREQ(thisdev, device)) { - if ((inserted =3D virJSONValueObjectGetObject(dev, "inserted")= ) && - (image =3D virJSONValueObjectGetObject(inserted, "image"))= ) { - return qemuMonitorJSONDiskNameLookupOne(image, top, target= ); - } - } - } - /* Guarantee an error when returning NULL, but don't override a - * more specific error if one was already generated. */ - if (virGetLastErrorCode() =3D=3D VIR_ERR_OK) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to find backing name for device %s"), - device); - } - - return NULL; -} - - int qemuMonitorJSONArbitraryCommand(qemuMonitor *mon, const char *cmd_str, int fd, diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 4f780e02aa..9a0bed0355 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -334,14 +334,6 @@ qemuMonitorJSONBlockCommit(qemuMonitor *mon, unsigned long long bandwidth) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -char * -qemuMonitorJSONDiskNameLookup(qemuMonitor *mon, - const char *device, - virStorageSource *top, - virStorageSource *target) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) - ATTRIBUTE_NONNULL(4); - int qemuMonitorJSONArbitraryCommand(qemuMonitor *mon, const char *cmd_str, --=20 2.36.1