From nobody Sun May 5 11:30:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1600918271; cv=none; d=zohomail.com; s=zohoarc; b=n0dSMyvBJqrvehpB5DTdFRItr5bf294nlOh0Jdk+1kBR7jcFi2LZbwchoDI//5fy97K/oOUQ9GrxGJYHec+y5HBiyQpEhN42o3TOHEmX23YJuSGGqWH4fLqvFggxmoR9RSeULdJNfwoEeGSRMm3nm32Ib4/0WRBZEAl25wNtCWE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600918271; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=s+KepyG3F8zU4/iCPGw+u8hYuPsEXD1lyVmIn97VtPc=; b=BN0qMvizFjEOpSJgmTAJpN9hTIN9lA0c10yMu3NA/AhTovotIyxlLBw6tAV2/o+EcZwQHTWCmwIlmlfhsvMqXItiba0jSHtavFoPmVVLkEBW1/PcDSlYZwXx7I9kOcyjbR9dPEisMh54Swcq3NXEwEEpAHTfjBoMBksQFii1IoY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 160091827131658.778659622351825; Wed, 23 Sep 2020 20:31:11 -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-588-mnDkHZD8O_yPk-J0F6vbOA-1; Wed, 23 Sep 2020 23:31:07 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0F617100748E; Thu, 24 Sep 2020 03:31:01 +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 E59AC5D990; Thu, 24 Sep 2020 03:30:59 +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 3D8A2183D043; Thu, 24 Sep 2020 03:30:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08O3UFlu015717 for ; Wed, 23 Sep 2020 23:30:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 40BAB2068533; Thu, 24 Sep 2020 03:30:15 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3AA0C2166B27 for ; Thu, 24 Sep 2020 03:30:12 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6EF208007DF for ; Thu, 24 Sep 2020 03:30:12 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [62.140.7.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-572-KWJ4BtFvNPCmGZDUZ0Wwlg-1; Wed, 23 Sep 2020 23:30:10 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2107.outbound.protection.outlook.com [104.47.17.107]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-4-aihjJP3nOUKXiaucH3Ug8Q-1; Thu, 24 Sep 2020 05:30:07 +0200 Received: from VI1PR0401MB2429.eurprd04.prod.outlook.com (2603:10a6:800:2c::13) by VI1PR04MB5533.eurprd04.prod.outlook.com (2603:10a6:803:cf::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20; Thu, 24 Sep 2020 03:30:05 +0000 Received: from VI1PR0401MB2429.eurprd04.prod.outlook.com ([fe80::810a:9a65:c33f:2f15]) by VI1PR0401MB2429.eurprd04.prod.outlook.com ([fe80::810a:9a65:c33f:2f15%7]) with mapi id 15.20.3412.021; Thu, 24 Sep 2020 03:30:05 +0000 Received: from linux-tbji.devlab.prv.suse.com (75.169.74.57) by AM0PR01CA0093.eurprd01.prod.exchangelabs.com (2603:10a6:208:10e::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.22 via Frontend Transport; Thu, 24 Sep 2020 03:30:04 +0000 X-MC-Unique: mnDkHZD8O_yPk-J0F6vbOA-1 X-MC-Unique: KWJ4BtFvNPCmGZDUZ0Wwlg-1 X-MC-Unique: aihjJP3nOUKXiaucH3Ug8Q-1 From: Jim Fehlig To: libvir-list@redhat.com Subject: [PATCH] tests: Adjust libxlxml2domconfigtest to work with Xen < 4.10 Date: Wed, 23 Sep 2020 21:29:42 -0600 Message-ID: <20200924032942.770-1-jfehlig@suse.com> X-ClientProxiedBy: AM0PR01CA0093.eurprd01.prod.exchangelabs.com (2603:10a6:208:10e::34) To VI1PR0401MB2429.eurprd04.prod.outlook.com (2603:10a6:800:2c::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Originating-IP: [75.169.74.57] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 85840316-a658-460e-c7ac-08d8603a2103 X-MS-TrafficTypeDiagnostic: VI1PR04MB5533: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Nyu/H3x290LN8RW5EEDXYby3Raykudp3v7XlVQ7s/VJQjl08PfGgtz1R8uBJiyi5YpfX4nzq78tKolNkxRG0ItSb1cF1FYjGLqVq77iuiRvqVk/5oWDE+zCkt6Y/4l6RWqcpiW3G4G+dBTDw9zYeuOHrgvJY0Hsf/V18FEQCVLMXfPfpPM3XoUMvpOUt8GXKv9q4rqOkTYabG5DoKIdKBXsk6GbcL8UIPyuGgL85VH00YK8u9XiitgrfKkBsXj0dqzhyhYqea7N9rvm8Gtl6Mi/3xbjkQpvknBIVMlnNkdXzOsZMJWvWwaZusXPpefY880XslZeFPEJg+1WJdmlZCg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0401MB2429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(376002)(346002)(39850400004)(396003)(366004)(16526019)(6916009)(7696005)(4326008)(52116002)(6486002)(186003)(36756003)(107886003)(478600001)(316002)(956004)(2616005)(8676002)(86362001)(26005)(5660300002)(2906002)(66476007)(66556008)(66946007)(1076003)(6666004)(83380400001)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: n66VeTRZlz1oemB8nmqJZOjvBnI/FPL6+rfFAY0a+6YscJv5wV0IB6718E66H0/xVfiKj5jB0B28Op85ACCNknrNPcnHHBNRN5qDBx8LGJVfZKH/eV+kJsM+Mi5IRNabW4JO2AUuipRKaPd1lwoL8P6Vbd0kexs6vv4VBIlpOLYpsM0WzRrVZx2bVmh9v2MKJrf0vufX5XU7ES+TYGhhfN/x2cBMs8L1jEggxPZv8vVYmOzfiPngUzV8wh8eEeUNQaLucdzYDkAQBhEgNoLuL2Y4RL7C/GGCJZGpLamdLvQjeuVxo9rfeNIXWNJm5blVeQJrp2LDG/VmdfVqSgHfeXQTMY+q94+1Z6uwpRq71xIqYGdNKEZSpOiT9Ru8DFFZWnUmZwC7K5+3gGzfm/bexwlgdHGZeb0pcujKhbjD5LMy6qOFVy8JjcX84YYl5/5zPwYrPKuE+NIgHrE+TxzhwM48VOzuxwL2LnMQcDmu7fOYUXxNfgIk6dOognwbMOj6YbwMxf8TXigcOhXMPO0X70jLZ/1fahE8coQRRjQxQ2izDUCzmMI1zJyCct1pQrPPzQWtpKLyOfiok8AazrFI/rhDDX90TUXEovcGxZo3bYqKAeYMcgLuHfX7zJX0tKDbU7hbAJrmfArhF9bmmqQ/rw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85840316-a658-460e-c7ac-08d8603a2103 X-MS-Exchange-CrossTenant-AuthSource: VI1PR0401MB2429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2020 03:30:05.4299 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: v7i/QsqMHDJBTNpOgCPbTq2C9KX5DaAe4/gs0cCQ8hG/vGPsIaGmdT4s7+j2AD/yTbbQ84pxXrO3mYhqUujS2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5533 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 08O3UFlu015717 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.79 on 10.5.11.14 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 Content-Type: text/plain; charset="utf-8" Commit f253dc90f5 introduced a test regression in environments with Xen < 4.10. The logic in libxl_conf.c correctly maps ACPI and APIC from virDomainObj to libxl_domain_conf based on LIBXL_HAVE_BUILDINFO_APIC, but the tests did not account for the different libxl_domain_conf JSON representations. One approach to fixing the test regression is to duplicate JSON test data files, having one set for Xen <=3D 4.9 and another for Xen 4.10 and greater. To avoid duplicate data files, this patch takes the approach of modifying the libxl_domain_conf object based on LIBXL_HAVE_BUILDINFO_APIC, before retrieving the JSON representation. It allows using the same test data files for all supported versions of Xen by adjusting the intermediate form of libxl_domain_conf object as needed. Signed-off-by: Jim Fehlig Reviewed-by: J=C3=A1n Tomko --- tests/libxlxml2domconfigtest.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/libxlxml2domconfigtest.c b/tests/libxlxml2domconfigtest.c index c4d5db9a7b..d58be1211b 100644 --- a/tests/libxlxml2domconfigtest.c +++ b/tests/libxlxml2domconfigtest.c @@ -97,6 +97,20 @@ testCompareXMLToDomConfig(const char *xmlfile, "Failed to create libxl_domain_config from JSON doc= "); goto cleanup; } + + /* + * In order to have common test files between Xen 4.9 and newer Xen ve= rsions, + * tweak the expected libxl_domain_config object before getting a json + * representation. + */ +# ifndef LIBXL_HAVE_BUILDINFO_APIC + if (expectconfig.c_info.type =3D=3D LIBXL_DOMAIN_TYPE_HVM) { + libxl_defbool_unset(&expectconfig.b_info.acpi); + libxl_defbool_set(&expectconfig.b_info.u.hvm.apic, true); + libxl_defbool_set(&expectconfig.b_info.u.hvm.acpi, true); + } +# endif + if (!(expectjson =3D libxl_domain_config_to_json(cfg->ctx, &expectconf= ig))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", "Failed to retrieve JSON doc for libxl_domain_confi= g"); --=20 2.28.0