From nobody Sun Feb 8 23:41:04 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=1652196126; cv=none; d=zohomail.com; s=zohoarc; b=fGkE2kP6ooNt05CwSr9jfggU6Mt+R4q9fYYoJgld3CBAh23JUgZFAbL0LdSNEnkfqlowIXmaBBb7dgW9wyhjMupGG+7YNv78zJ62KhU2oTDMceVOPjMVMlyYuhYAPtyrNsO+f8tTaZpY6nBRyuXS7dYO+KsErk7n+WLSlqLMYeU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652196126; 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=6nR/F6Mr8ybLguGrDi5LMdHxGGZJGioLzWkw0JiijKs=; b=WM425aRhIdQe5xivQ23Z6wO5XtCskTNFToQU2dSZwLOzFuzPGYF/RKXfWud9yAdIYiMbP4OO8E8qEFpmVKxcOOmfHBepUjxwhBVSRpQZdbABP/YBq9y2KmhKXP6Dn6UxsoMpgAkd/451Rmmi/V4PD4stJae9I4X5Eti5oFmS1Ng= 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 1652196126381903.2386655488548; Tue, 10 May 2022 08:22:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-269-a6cKeWCiPLiCDP32ViGwgA-1; Tue, 10 May 2022 11:21:58 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C1F273C7B13F; Tue, 10 May 2022 15:21:46 +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 A7B58463E1C; Tue, 10 May 2022 15:21:45 +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 614F21947055; Tue, 10 May 2022 15:21:45 +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 D054C194704D for ; Tue, 10 May 2022 15:21:44 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AAA16407DECC; Tue, 10 May 2022 15:21:44 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8AD7F407DEC3 for ; Tue, 10 May 2022 15:21:44 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 73E742445E6; Tue, 10 May 2022 17:21:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652196124; 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=6nR/F6Mr8ybLguGrDi5LMdHxGGZJGioLzWkw0JiijKs=; b=QCQ9y3YRyFo6Hrq8EmruHK/oA5BWOydbfW8HwMGmw52hvsuPNw8S1nsaLBAjLXO78zhZct ZRFSRoMJ+Eqr0i+J75cK2RTO6JhoQ0+S+xDW3mupuBkWU1XQEnfNRE3R/5t65ked/Gp00J r5YvGojmN261cpZtwGTb5szBM06ThK8= X-MC-Unique: a6cKeWCiPLiCDP32ViGwgA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 02/80] qemumonitorjsontest: Test more migration capabilities Date: Tue, 10 May 2022 17:20:23 +0200 Message-Id: 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.85 on 10.11.54.10 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: 1652196128477100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa --- tests/qemumonitorjsontest.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 278d7ba765..99198de0ed 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2047,7 +2047,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; @@ -2057,6 +2057,10 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapabi= lities(const void *opaque) " {" " \"state\": false," " \"capability\": \"xbzrle\"" + " }," + " {" + " \"state\": true," + " \"capability\": \"events\"" " }" " ]," " \"id\": \"libvirt-22\"" @@ -2075,11 +2079,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