From nobody Mon Feb 9 06:50:22 2026 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=1618836137; cv=none; d=zohomail.com; s=zohoarc; b=UP6v9yVEno8DA6aECu/cyQycZDx7gAHkn1Y1Xgc68NL4Uyp67UBcVPDRgpzhmjKQ2mk91XvfbI7IeoAluYnLYA+/dAlcTxEu7xLUSKnPkHuJI89NXVURftDoWaq1HCQvGYrUJv6falRT06Ao4ynN2IoCmNHwZaNFkq2zt0Wg930= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618836137; 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=0u3NjvRHyroOPGUEse9T2r2w9TlfKb2EoFqLytjcOTE=; b=HrlQ1I/zYo2NJpq7n+sYtrSloA+UrVM0hSHqm3zS+ss1CiVgOKLAPCmv5h/0rmu3TsZdwQgya3fLAgkTkONY7TfvVGYuUc1dohHwp9A8ZnrhLVEqNN9Ml2eDv2kgtqqdXyAyctsMRRIhLFgI9PbMxNg1QS7J604PWWhosSPsvLc= 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) header.from= 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 1618836137013763.6658584396853; Mon, 19 Apr 2021 05:42:17 -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-290-IYC_x2KWOYypM8xjsXRdKg-1; Mon, 19 Apr 2021 08:39:56 -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 B18DE83DD36; Mon, 19 Apr 2021 12:39:51 +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 8811110016FE; Mon, 19 Apr 2021 12:39: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 5173218184BE; Mon, 19 Apr 2021 12:39:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13JCaWGD019342 for ; Mon, 19 Apr 2021 08:36:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id B1A3719C66; Mon, 19 Apr 2021 12:36:32 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 051AB19C79 for ; Mon, 19 Apr 2021 12:36:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618836135; 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=0u3NjvRHyroOPGUEse9T2r2w9TlfKb2EoFqLytjcOTE=; b=HQSDgjkOVHOZRCOyAcvJyKkHl7mv5YdITsySjiamEBQlhuTmMFwwgWUU6nEw0MzK2dHJz1 K8YeFzR2tekP39GYbmLDpHdcUcnPR+lE+JybbMd0WVJvRMFZHAPTOHqaVeNzFOZ67DAXCQ VU2ephkita/JB6MSswXCnwMzcCSd1ug= X-MC-Unique: IYC_x2KWOYypM8xjsXRdKg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 29/38] qemu: monitor: Remove qemuMonitorSupportsActiveCommit Date: Mon, 19 Apr 2021 14:35:33 +0200 Message-Id: <0a931d450039d0c2c69604b5bebff0479af4cbf0.1618834490.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 Reviewed-by: Pavel Hrdina Reviewed-by: Neal Gompa --- 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 f28023e957..f6754a64ed 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3280,17 +3280,6 @@ qemuMonitorBlockCommit(qemuMonitor *mon, } -/* Probe whether active commits are supported by a given qemu binary. */ -bool -qemuMonitorSupportsActiveCommit(qemuMonitor *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 a39e8e6e82..a1cf2856eb 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1046,7 +1046,6 @@ int qemuMonitorBlockCommit(qemuMonitor *mon, const char *backingName, unsigned long long bandwidth) ATTRIBUTE_NONNULL(2); -bool qemuMonitorSupportsActiveCommit(qemuMonitor *mon); char *qemuMonitorDiskNameLookup(qemuMonitor *mon, const char *device, virStorageSource *top, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 534ab75c2c..0e405aa821 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4726,39 +4726,6 @@ qemuMonitorJSONTransaction(qemuMonitor *mon, virJSON= Value **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(qemuMonitor *mon) -{ - bool ret =3D false; - virJSONValue *cmd; - virJSONValue *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 97b8d2a991..2a76b33b9b 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -276,9 +276,6 @@ int qemuMonitorJSONDrivePivot(qemuMonitor *mon, const char *jobname) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -bool qemuMonitorJSONSupportsActiveCommit(qemuMonitor *mon) - ATTRIBUTE_NONNULL(1); - int qemuMonitorJSONBlockCommit(qemuMonitor *mon, const char *device, const char *jobname, diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 0866ebe2bf..0e4b1b4954 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2145,49 +2145,6 @@ testQemuMonitorJSONqemuMonitorJSONSendKeyHoldtime(co= nst void *opaque) return 0; } -static int -testQemuMonitorJSONqemuMonitorSupportsActiveCommit(const void *opaque) -{ - const testGenericData *data =3D opaque; - virDomainXMLOption *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) { @@ -3136,7 +3093,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