From nobody Sun Feb 8 12:19:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1654087848; cv=none; d=zohomail.com; s=zohoarc; b=KJWwrzkNqr7HQiSvRQcjKGzIqMTzKg5IMuPmTRO/TutXJEa5sC9AQopkFN4qfEMdtbAUSB/1ayoQ0OsXad2jTdUGodI4+RzjezXk5ea/IVq282eltIwVzJdL2XJHBwRqmaibfSh7tsHeIe7wfndh/Or6nR5l1BZsJ7FRc4Vl5Es= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654087848; h=Content-Type:Content-Transfer-Encoding:Cc: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=ppYFmyvoL4hK7quCjG3rtuFue8XbYy0AW9fs1Uaevdg=; b=c9sa++LiTuD4gUuVU1tpZtOlEIPoM3CrQmAP4rHmcdeCpUPLVxm7XRty3O/nFQfJuMm11TaZbu3MZZXIw/IljJCiOVuqJNP58/NhpFm0iFDb6tj/UhgFNaC2/C0b6sdJqynhsQ5WE979FctC4Q2IQphqPS/0qSC2inxuuQIeh1g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1654087848582872.9897191297678; Wed, 1 Jun 2022 05:50:48 -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-523-e_Th7AtOMRSfBZXKPTq8-Q-1; Wed, 01 Jun 2022 08:50:35 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 75A9D101A54E; Wed, 1 Jun 2022 12:50:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17D501415100; Wed, 1 Jun 2022 12:50:28 +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 96FFB1947079; Wed, 1 Jun 2022 12:50:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9DE94194706A for ; Wed, 1 Jun 2022 12:50:26 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8E9AD40EC004; Wed, 1 Jun 2022 12:50:26 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6DD7F40EC002; Wed, 1 Jun 2022 12:50:26 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 5F4C0245B4E; Wed, 1 Jun 2022 14:50:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654087847; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=ppYFmyvoL4hK7quCjG3rtuFue8XbYy0AW9fs1Uaevdg=; b=hDspRFxFE6kBwmIw1URE3dnRtQjjiIC+hj+IUYVJJiPKeu3GTPTOasToKSSeaVF922/BVm AKjy5wJNw14bHH5acHTnMWiDxHnc6TsYYgbnIH7hK8nm+FpyKovpJ5TCxkvwWbjjTAPk3S blSXGhxOUPuAtA0a+lPIAjqmnCJct6k= X-MC-Unique: e_Th7AtOMRSfBZXKPTq8-Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH v2 02/81] qemumonitorjsontest: Test more migration capabilities Date: Wed, 1 Jun 2022 14:49:02 +0200 Message-Id: <7ce0bc3427da19ef75dba729e0b4e5a3a50fb075.1654087149.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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: , Cc: Peter Krempa , Pavel Hrdina Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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: 1654087849725100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa Reviewed-by: Pavel Hrdina --- Notes: Version 2: - no change tests/qemumonitorjsontest.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index c3ee771cbb..2de282dcba 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2044,7 +2044,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapabil= ities(const void *opaque) { const testGenericData *data =3D opaque; virDomainXMLOption *xmlopt =3D data->xmlopt; - const char *cap; + size_t cap; g_auto(GStrv) caps =3D NULL; g_autoptr(virBitmap) bitmap =3D NULL; g_autoptr(virJSONValue) json =3D NULL; @@ -2054,6 +2054,10 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapabi= lities(const void *opaque) " {" " \"state\": false," " \"capability\": \"xbzrle\"" + " }," + " {" + " \"state\": true," + " \"capability\": \"events\"" " }" " ]," " \"id\": \"libvirt-22\"" @@ -2072,11 +2076,25 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapab= ilities(const void *opaque) &caps) < 0) return -1; =20 - cap =3D qemuMigrationCapabilityTypeToString(QEMU_MIGRATION_CAP_XBZRLE); - if (!g_strv_contains((const char **) caps, cap)) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "Expected capability %s is missing", cap); - return -1; + for (cap =3D 0; cap < QEMU_MIGRATION_CAP_LAST; cap++) { + const char *capStr =3D qemuMigrationCapabilityTypeToString(cap); + bool present =3D g_strv_contains((const char **) caps, capStr); + + switch (cap) { + case QEMU_MIGRATION_CAP_XBZRLE: + case QEMU_MIGRATION_CAP_EVENTS: + if (!present) { + VIR_TEST_VERBOSE("Expected capability %s is missing", capS= tr); + return -1; + } + break; + + default: + if (present) { + VIR_TEST_VERBOSE("Unexpected capability %s found", capStr); + return -1; + } + } } =20 bitmap =3D virBitmapNew(QEMU_MIGRATION_CAP_LAST); --=20 2.35.1