From nobody Mon Feb 9 12:26:02 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=1680183694; cv=none; d=zohomail.com; s=zohoarc; b=Z754XJLTcbKloccVal0Rmiiso78p074SKjdF9Rl9XNzIaP8GvzE002VwwALNYheuZsyG9ERGJx/Yv7AeuX7Olr6arClhnZc1dxW3cVpM6IZkaWIG1iIpvDPt46dxsu4GGyVv5gbSRuSy7ai0KpBjib29Ou7T2ncy1Z5tp3bpi2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183694; 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=oAs+5OTCILmzzcc4CjUs6M7Voq68Ia4O0MN0c2e01QY=; b=BQQmkJVNve5dY+ojLRFxRFSS79vG0M9c2yZ2x5H6Ppq1/Wigj3Ju5cxQdqBWsHrn0fAx+FkVLMCs1hpZpHXTNlQcDY2ksPE++LJgPW3wJO1V2yAJbqa+BYIq5ODPqKDTndJMFTSkRJdlbNvDDTvOaMkWQtT3ltZr8AGYCNkK4Yk= 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 168018369467368.00755064454859; Thu, 30 Mar 2023 06:41:34 -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-595-4WnUQ9e8Pvy1IcMFKF_HPQ-1; Thu, 30 Mar 2023 09:41:28 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9AD1485C074; Thu, 30 Mar 2023 13:41:23 +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 87C82440DD; Thu, 30 Mar 2023 13:41:23 +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 B5102194E015; Thu, 30 Mar 2023 13:39:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BB7DB1946A49 for ; Thu, 30 Mar 2023 13:38:47 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B70F42166B34; Thu, 30 Mar 2023 13:38:47 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 325592166B33 for ; Thu, 30 Mar 2023 13:38:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183693; 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=oAs+5OTCILmzzcc4CjUs6M7Voq68Ia4O0MN0c2e01QY=; b=JkgOEoLGP/km4PVqfW0znMmwF5HZLH139SZDUCqbZknK3ZO/O+wY+xwQH7yyBN5SaUHD0j t5vDJSKutabszx8x/ehFialY2EFxI7SaW+vkR74zq5FsgOKU6f8KWRummAFdwkDpsTyVGM ktPg8wyevMHrt/XIrz2vabJCCReaaOk= X-MC-Unique: 4WnUQ9e8Pvy1IcMFKF_HPQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 21/31] qemuhotplugtest: Make the test more useful by validating used commands against QMP schema Date: Thu, 30 Mar 2023 15:38:15 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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 3.1 on 10.11.54.5 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: 1680183963719100001 Content-Type: text/plain; charset="utf-8" qemuhotplugtest validates only that a given command is used but not the arguments of the command. With this patch we'll validate the arguments against the QMP schema thus we can catch possible issues with deprecated commands. Signed-off-by: Peter Krempa --- tests/qemuhotplugtest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 9c8407c5ef..63a6833cfd 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -57,6 +57,7 @@ struct qemuHotplugTestData { GHashTable *capsLatestFiles; GHashTable *capsCache; GHashTable *schemaCache; + GHashTable *schema; }; static int @@ -342,7 +343,7 @@ testQemuHotplug(const void *data) if (qemuHotplugCreateObjects(driver.xmlopt, &vm, domain_xml, test->arch, test->capsLatestFiles, test->capsCache, test->schemaCache, - NULL) < 0) + &test->schema) < 0) goto cleanup; } @@ -356,7 +357,7 @@ testQemuHotplug(const void *data) /* Now is the best time to feed the spoofed monitor with predefined * replies. */ - if (!(test_mon =3D qemuMonitorTestNew(driver.xmlopt, vm, NULL, NULL))) + if (!(test_mon =3D qemuMonitorTestNew(driver.xmlopt, vm, NULL, test->s= chema))) goto cleanup; tmp =3D test->mon; --=20 2.39.2