From nobody Mon Feb 9 11:07:24 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=1617980517; cv=none; d=zohomail.com; s=zohoarc; b=O+Bb2La/akbzQkp/NXz6t5erDINe7k+utxnsAI6EryEIF6jBFK4rRlyRLOkZmO7rTb9PHQJEEs9xivPDOaEF/32GjrM8ZXpluz+vgZ8k+zizROjUhQRgqiCwC764ink2inRfgwRX3h5HunY/UBCf8jNaklYtzKt4jN3x09RrEl4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617980517; 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=QvaJxVHBPLp/WdpqyJ4FFFBM50kVpiktrArxeNIZ/pU=; b=XCEOVyU1kzNTDW/K31JmNm+S9UW0Aa9b/EyDh34p2h6VKRyPF+cEJpFaD92RhtM/fRyY0nYDkwvJvT4iFT2Qto6vb8/+mGwmcLvWWEJ+EmVfXXdYVMegOJ4GjgGlQz9onnRL8ueygtalx8ti3Dl6tcqJYlKpvBHZNfgxaOwhV9o= 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 1617980517335385.399686528795; Fri, 9 Apr 2021 08:01:57 -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-588-cKS2RnvxO-mm5iD-nr6rOQ-1; Fri, 09 Apr 2021 11:01:51 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A228107ACF9; Fri, 9 Apr 2021 15:01:47 +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 038FE10027C4; Fri, 9 Apr 2021 15:01:47 +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 B9D131806D17; Fri, 9 Apr 2021 15:01:46 +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 139EwQdH024080 for ; Fri, 9 Apr 2021 10:58:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id B0A4114106; Fri, 9 Apr 2021 14:58:26 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1255860D79 for ; Fri, 9 Apr 2021 14:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617980513; 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=QvaJxVHBPLp/WdpqyJ4FFFBM50kVpiktrArxeNIZ/pU=; b=abCYt9f8XpG2918reEz19ELnx4i4p5nz5Hj84Lkq0Veg5GAY96XwU92fNIIaSq4TuvQgFY KKem1Pid3DVgoTv3ppV3M+i+dBJP8KnLZ/KRXXaYj8RyQnoHZ7ieeeIyvuIdRjfBnt2/3m 0ErvCMVDjcwqvywNNaG4Q3uG++IMYEw= X-MC-Unique: cKS2RnvxO-mm5iD-nr6rOQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [RFC PATCH 40/43] qemu: monitor: Remove qemuMonitorSupportsActiveCommit Date: Fri, 9 Apr 2021 16:57:16 +0200 Message-Id: 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 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.22 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" Modern code uses QMP schema to query for active commit support. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 11 --------- src/qemu/qemu_monitor.h | 1 - src/qemu/qemu_monitor_json.c | 33 --------------------------- src/qemu/qemu_monitor_json.h | 3 --- tests/qemumonitorjsontest.c | 44 ------------------------------------ 5 files changed, 92 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index f337f20140..375c56ca9f 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3280,17 +3280,6 @@ qemuMonitorBlockCommit(qemuMonitorPtr mon, } -/* Probe whether active commits are supported by a given qemu binary. */ -bool -qemuMonitorSupportsActiveCommit(qemuMonitorPtr mon) -{ - if (!mon) - return false; - - return qemuMonitorJSONSupportsActiveCommit(mon); -} - - /* Determine the name that qemu is using for tracking the backing * element TARGET within the chain starting at TOP. */ char * diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 310635881d..6cb04d6f76 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1067,7 +1067,6 @@ int qemuMonitorBlockCommit(qemuMonitorPtr mon, const char *backingName, unsigned long long bandwidth) ATTRIBUTE_NONNULL(2); -bool qemuMonitorSupportsActiveCommit(qemuMonitorPtr mon); char *qemuMonitorDiskNameLookup(qemuMonitorPtr mon, const char *device, virStorageSourcePtr top, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index f7a84f86e6..0732e2dc1e 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4726,39 +4726,6 @@ qemuMonitorJSONTransaction(qemuMonitorPtr mon, virJS= ONValuePtr *actions) return ret; } -/* Probe if active commit is supported: pass in a bogus device and NULL top - * and base. The probe return is true if active commit is detected or fal= se - * if not supported or on any error */ -bool -qemuMonitorJSONSupportsActiveCommit(qemuMonitorPtr mon) -{ - bool ret =3D false; - virJSONValuePtr cmd; - virJSONValuePtr reply =3D NULL; - - if (!(cmd =3D qemuMonitorJSONMakeCommand("block-commit", "s:device", - "bogus", NULL))) - return false; - - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - goto cleanup; - - if (qemuMonitorJSONHasError(reply, "DeviceNotFound")) { - VIR_DEBUG("block-commit supports active commit"); - ret =3D true; - goto cleanup; - } - - /* This is a false negative for qemu 2.0; but probably not - * worth the additional complexity to worry about it */ - VIR_DEBUG("block-commit requires 'top' parameter, " - "assuming it lacks active commit"); - cleanup: - virJSONValueFree(cmd); - virJSONValueFree(reply); - return ret; -} - /* speed is in bytes/sec. Returns 0 on success, -1 with error message * emitted on failure. */ diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 9e046df9fe..91a8ef9878 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -276,9 +276,6 @@ int qemuMonitorJSONDrivePivot(qemuMonitorPtr mon, const char *jobname) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -bool qemuMonitorJSONSupportsActiveCommit(qemuMonitorPtr mon) - ATTRIBUTE_NONNULL(1); - int qemuMonitorJSONBlockCommit(qemuMonitorPtr mon, const char *device, const char *jobname, diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 48b41c908a..184c608e5c 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2146,49 +2146,6 @@ testQemuMonitorJSONqemuMonitorJSONSendKeyHoldtime(co= nst void *opaque) return 0; } -static int -testQemuMonitorJSONqemuMonitorSupportsActiveCommit(const void *opaque) -{ - const testGenericData *data =3D opaque; - virDomainXMLOptionPtr xmlopt =3D data->xmlopt; - const char *error1 =3D - "{" - " \"error\": {" - " \"class\": \"DeviceNotFound\"," - " \"desc\": \"Device 'bogus' not found\"" - " }" - "}"; - const char *error2 =3D - "{" - " \"error\": {" - " \"class\": \"GenericError\"," - " \"desc\": \"Parameter 'top' is missing\"" - " }" - "}"; - g_autoptr(qemuMonitorTest) test =3D NULL; - - if (!(test =3D qemuMonitorTestNewSchema(xmlopt, data->schema))) - return -1; - - if (qemuMonitorTestAddItemParams(test, "block-commit", error1, - "device", "\"bogus\"", - NULL, NULL) < 0) - return -1; - - if (!qemuMonitorSupportsActiveCommit(qemuMonitorTestGetMonitor(test))) - return -1; - - if (qemuMonitorTestAddItemParams(test, "block-commit", error2, - "device", "\"bogus\"", - NULL, NULL) < 0) - return -1; - - if (qemuMonitorSupportsActiveCommit(qemuMonitorTestGetMonitor(test))) - return -1; - - return 0; -} - static int testQemuMonitorJSONqemuMonitorJSONGetDumpGuestMemoryCapability(const void = *opaque) { @@ -3137,7 +3094,6 @@ mymain(void) DO_TEST(qemuMonitorJSONSendKey); DO_TEST(qemuMonitorJSONGetDumpGuestMemoryCapability); DO_TEST(qemuMonitorJSONSendKeyHoldtime); - DO_TEST(qemuMonitorSupportsActiveCommit); DO_TEST(qemuMonitorJSONNBDServerStart); DO_TEST_CPU_DATA("host"); --=20 2.30.2