From nobody Mon Apr 29 12:50:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1659109859; cv=none; d=zohomail.com; s=zohoarc; b=LmfsNDMqi0EbBff2AMGFYDynatd2dLzajhz9HygRC9oqhWFjFbbJax6ScPYMz1CLGn49Atcw2tQ1djiV/6HcN7FitclePjaBMCwcsEOaVWT2IgLEOfiuCrPeTyDWi6G8LOmuO6XB0VAQynUIKZzbAwmI7YMRXJDSh04zZKAHWJ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659109859; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=S01wSBMMcdelVnVjOkH9lCwWoMGdbRzrK7HqSib69Hg=; b=IomV+Ctv+0VxF6OmIuF8UjhSN+7OIul+6PIDFYtrJhxZ8i+SbBw9XTxI0T50Tqg4aTPbeiwh8IQJ6iepLy63zDdK0MwJp7GbIxqi4zWgrK/3qSRPE32C6WG5WscxNZqQBIbazcbLHeoFrGv25KQeP407QqN61nL71lr6tWKPFKE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1659109859106302.8057750915963; Fri, 29 Jul 2022 08:50:59 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.377619.610887 (Exim 4.92) (envelope-from ) id 1oHSFz-0004tw-Uq; Fri, 29 Jul 2022 15:50:31 +0000 Received: by outflank-mailman (output) from mailman id 377619.610887; Fri, 29 Jul 2022 15:50:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oHSFz-0004tp-QN; Fri, 29 Jul 2022 15:50:31 +0000 Received: by outflank-mailman (input) for mailman id 377619; Fri, 29 Jul 2022 15:50:31 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oHSFz-0004tj-6J for xen-devel@lists.xenproject.org; Fri, 29 Jul 2022 15:50:31 +0000 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [2a00:1450:4864:20::12c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 2c048b38-0f56-11ed-bd2d-47488cf2e6aa; Fri, 29 Jul 2022 17:50:30 +0200 (CEST) Received: by mail-lf1-x12c.google.com with SMTP id bf9so7872620lfb.13 for ; Fri, 29 Jul 2022 08:50:30 -0700 (PDT) Received: from otyshchenko.router ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id bp23-20020a056512159700b0048a835a60f6sm693428lfb.251.2022.07.29.08.50.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jul 2022 08:50:28 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2c048b38-0f56-11ed-bd2d-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=S01wSBMMcdelVnVjOkH9lCwWoMGdbRzrK7HqSib69Hg=; b=LFp7OCtLArAWZrWOeuJsky9HKKLt42lomc5ZCZlwDVu7gTbyAhWxVFxCHMqauI5zQP XrQjSoQnO+SwTEVZPkTLnp8siPxVgTADZviZjxWaT0FhHniUCT1AuZR6+wWux2lfKdHr wtAfBqGskxrja9bdWbmbc1qLUMioLFT7HS5cClX7hIQhm+DzV/S8z3pqMbiv25UL3aeZ he/avPFnqs2Hug7Lzv94C6QulY10W8FMDp1MwxXQ3OGW3hWZ2psFppL62R3rnpIFqTTr uKOykqGzCXBQFnDcQgrON0kzlrv1OBOMRjRWpd5HTEK88zqNSm9XOzyCmnPRMSvuVN64 XVqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=S01wSBMMcdelVnVjOkH9lCwWoMGdbRzrK7HqSib69Hg=; b=Sbw7xwhxFGyi1H3GBzseW0sZAfLI2o14XPplnglmM871Z57dR8XRr/k8PtUO5Eq5fJ ay6t3wwEUgUgwvT3vofQkWpS5i8DskEzZiW85uSUpbHcDqIzCC7Zgnp8YX/Q5Yyzel7V ONwpzHbD62BnjyeOZTbBFF2hdqpXZbMWmRdmyocbPuRA0zyjlMLNfrWpSVH8J4+ZDyEn Qeo0p4z3fbvF6U9AMfEIcmKrfNggO+KZnv/EF7OSmv2L/NawfUVpRC+jN0bNKottKNck 7U59wmQSI5R0v9eYR0kx/9oUYOWsCovqNf0+5alJdIaKVHaqhhliEXbxJbVyrSV7IUhk GnWg== X-Gm-Message-State: ACgBeo1HoE1vpx5ySHU/JXXPN6Xg5uSjlAfy3e+F22Y0EZ/xK+1d5j9j 3qFLfFO6VonbCE9tdmZusmyRwWhM4SRzlA== X-Google-Smtp-Source: AA6agR7I0GXQBFySP974763gBQRcBZVi3iQZyVTmh3NffVj56BJeEOk++Kyr+zNdGBCsmPwcxzVclw== X-Received: by 2002:a05:6512:1292:b0:48a:e693:9da3 with SMTP id u18-20020a056512129200b0048ae6939da3mr566261lfs.328.1659109828939; Fri, 29 Jul 2022 08:50:28 -0700 (PDT) From: Oleksandr Tyshchenko To: xen-devel@lists.xenproject.org, libvir-list@redhat.com Cc: Oleksandr Tyshchenko , Julien Grall , Anthony PERARD , Michal Privoznik Subject: [libvirt PATCH] libxl: Fix build with recent Xen that introduces new disk backend type Date: Fri, 29 Jul 2022 18:50:24 +0300 Message-Id: <20220729155024.3327364-1-olekstysh@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1659109859653100001 Content-Type: text/plain; charset="utf-8" From: Oleksandr Tyshchenko Xen toolstack has gained basic Virtio support recently which becides adding various virtio related stuff introduces new disk backend type LIBXL_DISK_BACKEND_STANDALONE [1]. Unfortunately, this caused a regression in libvirt build with Xen support enabled, reported by the osstest today [2]: CC libxl/libvirt_driver_libxl_impl_la-xen_xl.lo ../../src/libxl/xen_xl.c: In function 'xenParseXLDisk': ../../src/libxl/xen_xl.c:779:17: error: enumeration value 'LIBXL_DISK_BACKE= ND_STANDALONE' not handled in switch [-Werror=3Dswitch-enum] switch (libxldisk->backend) { ^~~~~~ cc1: all warnings being treated as errors The interesting fact is that switch already has a default branch (which oug= ht to cover such new addition), but the error is triggered as -Wswitch-enum gives a warning about an omitted enumeration code even if there is a default label. Also there is a similar issue in libxlUpdateDiskDef() which I have reproduc= ed after fixing the first one, but it that case the corresponding switch doesn= 't have a default branch. Fix both issues by inserting required enumeration item to make the compiler happy and adding ifdef guard to be able to build against old Xen libraries as well (without LIBXL_HAVE_DEVICE_DISK_SPECIFICATION). Also add a default branch to switch in libxlUpdateDiskDef(). Please note, that current patch doesn't implement the proper handling of LIBXL_DISK_BACKEND_STANDALONE and friends, it is just intended to fix the regression immediately to unblock the osstest. Also it worth mentioning that current patch won't solve the possible additions in the future. [1] https://lore.kernel.org/xen-devel/20220716163745.28712-1-olekstysh@gmai= l.com/ [2] https://lore.kernel.org/xen-devel/E1oHEQO-0008GA-Uo@osstest.test-lab.xe= nproject.org/ Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Michal Privoznik --- Cc: Julien Grall Cc: Anthony PERARD Cc: Michal Privoznik Please note, the patch is tested on: https://xenbits.xen.org/gitweb/?p=3Dlibvirt.git;a=3Dshortlog;h=3Drefs/heads= /xen-tested-master but should work on the master as well (as the same code is present here). --- src/libxl/libxl_conf.c | 4 ++++ src/libxl/xen_xl.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index aa3d7925ec..526f0b2b08 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -1240,6 +1240,10 @@ libxlUpdateDiskDef(virDomainDiskDef *l_disk, libxl_d= evice_disk *x_disk) driver =3D "phy"; break; case LIBXL_DISK_BACKEND_UNKNOWN: +#ifdef LIBXL_HAVE_DEVICE_DISK_SPECIFICATION + case LIBXL_DISK_BACKEND_STANDALONE: +#endif + default: break; } if (driver) diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index 4de4e3140f..6919325623 100644 --- a/src/libxl/xen_xl.c +++ b/src/libxl/xen_xl.c @@ -715,6 +715,9 @@ xenParseXLDisk(virConf *conf, virDomainDef *def) virDomainDiskSetDriver(disk, "phy"); virDomainDiskSetType(disk, VIR_STORAGE_TYPE_BLOCK); break; +#ifdef LIBXL_HAVE_DEVICE_DISK_SPECIFICATION + case LIBXL_DISK_BACKEND_STANDALONE: +#endif default: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("disk backend not supported: %s"), --=20 2.25.1