From patchwork Tue Jul 26 19:21:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 593473 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b811:0:0:0:0 with SMTP id fc17csp3824391mab; Tue, 26 Jul 2022 12:39:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vyKv3aooUjbAtSuTtt9P/iQCQCVaL1DQKx3K1gU8qY3OcNaSxfnkKePUigJuL27eJ+ht6v X-Received: by 2002:a05:6214:2a82:b0:474:6a7d:ce7c with SMTP id jr2-20020a0562142a8200b004746a7dce7cmr3837481qvb.101.1658864362180; Tue, 26 Jul 2022 12:39:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658864362; cv=none; d=google.com; s=arc-20160816; b=iCmkA5ZlolBupcUjdvRwkczI08Zb3Ne/98FVxLKvEiidvNDDV1YC7m/nE+GPv7scCD 7K5ZOMQWyxKb9QGIIK82cz+1AokCIIx7XzrqMxV+ntbguRCiRXqX4KrVtSwvDsddxjQC rBGE86Y0KAhCYui4cdFohJ5W1eeG+9ASrQD2ddSlpGBYGt0RDyrGC/Uno/0noZZgDMuc H46Uu4YSJ+PqZ/mr8y+xL9uvLNbrS0+L2IHyJCUm2x72qTEOOS4I9/Kha1JrzVUFuAXi CJPJZQJbhRNAeMNo4hPumJ+H6AZBbvgLdl6wSWQwxFyZixM3Km2+YDB6Ophn5xe2aLsk tvqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PYaGkXjsZkoph9fA5YpZi9kVlMvB2mVtLyywEwpEssY=; b=ZkiF8vf7weQ0O7+L5ColWLiEtgIBwhFurWgrihHmVAL5x/6qkIZRCDyQ8rFcclgHxg PVS4QR8DFtNpWkJ7XjoZPnpoC9mKeUM4GutNSlUVXmfcq1qbJZB7lB9wE09yWWFgjupp 0xdxEPP7L8RwHWn8O7tcbsChha6WGkWQJoNF2TbyXIgYuNHr32bzVqwnx2insdPa6P1z pOAjw5MGBawJwqm/YpWCSU3GH7eptfK58nljOSyo6t5iJKgBwChWQgNCj5X/kA4fS/5K JU5Jl/255EbpdvF5athozwZ7Izk2t+wHTAtXV1NNGiRBQWF/9FgSr34R9FuFJIyGx5W5 qxqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ual7CBUu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o11-20020a0562140e4b00b00474569d76b9si2307516qvc.430.2022.07.26.12.39.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Jul 2022 12:39:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ual7CBUu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGQOl-0003OB-H8 for patch@linaro.org; Tue, 26 Jul 2022 15:39:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGQGC-0006bt-BN for qemu-devel@nongnu.org; Tue, 26 Jul 2022 15:30:35 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:39720) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGQG6-0003bT-1y for qemu-devel@nongnu.org; Tue, 26 Jul 2022 15:30:24 -0400 Received: by mail-wr1-x435.google.com with SMTP id d8so21379539wrp.6 for ; Tue, 26 Jul 2022 12:30:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PYaGkXjsZkoph9fA5YpZi9kVlMvB2mVtLyywEwpEssY=; b=ual7CBUuvRDdw1MsLKJ5y9GezAGN+AST2WPzf2yk2Np9/RY3mmGfEDID+i+ed+M2h3 g8jLpNPySYjNuKdDSBLr3Ss9dOfDD+AoSxGU+45BFKwg3DJ0gxPAP4sSEC95FMW8nDsS fohp7/TfA0kv/qeuCvtzrwknoecHBdndJcwBKds/Hw0jPC0+oMA09sltLXolo31IV4Wh AUVXml4r7bEj2zIrM6M1FEKkO8wJeq27dJE5gjhxoK2wSZSuYEGl+cBf7Jpe5GpI8Q5w rqa4AcoeuTfU0dhP2WRfgzyp8PjIdSQGenvZ5epopNoyumjGkG3GUmAHEGgMUqpASi85 pFeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PYaGkXjsZkoph9fA5YpZi9kVlMvB2mVtLyywEwpEssY=; b=srdW51lmWNXKgsXhm648cZwVZJnV1lb52ZEr57DClHXn4vArepocgTChHs3+PHNeyE sCtHIfoqXkFEb0JzGb3kyqDqmTMi4vPfExCHp3mYPHSeVLc/4jlZyU1mzyYyAxx5iRTK t9uV18qyJImVPEd+6lSP5s2QFJNA3YvPAwwAQFA5q9u852iXjjSEYslWLLasrtFaxIAq IsDewfqSApgbuCMs8OP6dxDuCyvM5PxeeBYzEnxeQ8VCv0wIIKo2NNID54/2qZTNwy3m +7BMvbydoE67b5OpToxgznhXR7YW9738XbFGXPNoIoy0iQOqL4JpdxOWwyNLIAf/Iww8 q8Mg== X-Gm-Message-State: AJIora/qBKYQZAOOR9pt2SKoOM+R64+TxzAzXpSb7F3G6m0i/lT4PlUK 0pqRpa/QQZnKazafv09wIdSudA== X-Received: by 2002:a5d:59c6:0:b0:21e:86fe:fcc6 with SMTP id v6-20020a5d59c6000000b0021e86fefcc6mr8196415wry.139.1658863819519; Tue, 26 Jul 2022 12:30:19 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id q6-20020a1cf306000000b0039c5ab7167dsm21916848wmq.48.2022.07.26.12.30.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 12:30:14 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CB3A41FFCA; Tue, 26 Jul 2022 20:21:51 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: slp@redhat.com, mst@redhat.com, marcandre.lureau@redhat.com, stefanha@redhat.com, mathieu.poirier@linaro.org, viresh.kumar@linaro.org, mark.cave-ayland@ilande.co.uk, jasowang@redhat.com, =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Thomas Huth , Laurent Vivier , Paolo Bonzini Subject: [PATCH v3 18/21] tests/qtest: add assert to catch bad features Date: Tue, 26 Jul 2022 20:21:47 +0100 Message-Id: <20220726192150.2435175-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220726192150.2435175-1-alex.bennee@linaro.org> References: <20220726192150.2435175-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" No device driver (which is what the qvirtio_ access functions represent) should be setting UNUSED(30) in the feature space. Although existing libqos users mask it out lets ensure nothing sneaks through. Signed-off-by: Alex Bennée --- tests/qtest/libqos/virtio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qtest/libqos/virtio.c b/tests/qtest/libqos/virtio.c index 09ec09b655..03056e5187 100644 --- a/tests/qtest/libqos/virtio.c +++ b/tests/qtest/libqos/virtio.c @@ -101,6 +101,8 @@ uint64_t qvirtio_get_features(QVirtioDevice *d) void qvirtio_set_features(QVirtioDevice *d, uint64_t features) { + g_assert(!(features & QVIRTIO_F_BAD_FEATURE)); + d->features = features; d->bus->set_features(d, features);