From nobody Tue May 14 21:21:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1645026101; cv=none; d=zohomail.com; s=zohoarc; b=DLmcs9YBEmI6FZMgiQlt8NML7cjkW2ZD/qxYfVyNwPgI4g70FBs3kBqkTGB4Sqx4e/Vk7kJQJ0RGMyX0Pg/bEVICAECs3eSZSIcRz9lmtczACmtRGNtL8dgqenyupYBH85mhdwEF4k2x1WXsITJdrSr0cuB/KOupOF5S3Tg1EHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645026101; 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=Wbko1QuYNnecMP8Tbbj3kgi8qLHB+Y76jD+dRIMZREc=; b=SV+35jhosFnD0yb7BnquXxzpdthoH0GP+b060fanEmypB64N6podUnFLpFl9UUFttMeDLJ+AL3kGgUb3D8XBLd1h0Eu05T2PeYz6Zup8mMpW0YBmG1lJvWh7QtXIWDd9WCI6wk+ipjpI8W6NfBYxgcEiUA3/vCq2TsSzXYbOxYc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1645026101767298.2215917311685; Wed, 16 Feb 2022 07:41:41 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-552-W-AGZ9HaMPedErgEujlymg-1; Wed, 16 Feb 2022 10:41:39 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4165C80292E; Wed, 16 Feb 2022 15:41:34 +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 1D00570D5B; Wed, 16 Feb 2022 15:41:34 +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 DC16918033AE; Wed, 16 Feb 2022 15:41:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21GFfMGw021080 for ; Wed, 16 Feb 2022 10:41:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8B23D74E95; Wed, 16 Feb 2022 15:41:22 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6D4674E8A for ; Wed, 16 Feb 2022 15:41:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645026100; 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=Wbko1QuYNnecMP8Tbbj3kgi8qLHB+Y76jD+dRIMZREc=; b=B6tdlm6LtRcJHUmvBKM1Yzn+jMDNj9i1L/47J3ccI0h5zeaCqIFK9GbL1xzktiFPBfdWb0 ZwwrGlZYyfNLoCh9WGd5MwoJTrpIeBaO6GSjW7ZWROl2sWxe3jRlhGXpey7LnRqW5SGOp4 NF/bHYKCxCMOrjvmgFaGtYmS0oFx9AI= X-MC-Unique: W-AGZ9HaMPedErgEujlymg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/8] driver: Introduce global driver feature flag handling function Date: Wed, 16 Feb 2022 16:41:05 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.11 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: 1645026103103100001 Content-Type: text/plain; charset="utf-8" The 'virDrvFeature' has a combination of features which are asserted by the specific driver and features which are actually global. In many cases the implementation was cargo-culted into newer drivers without re-assesing whether it makes sense. This patch introduces a global function which will specifically handle these global flags and defer the rest to the driver. Signed-off-by: Peter Krempa Reviewed-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/ch/ch_driver.c | 5 +++++ src/driver.c | 41 +++++++++++++++++++++++++++++++++++++ src/driver.h | 3 +++ src/esx/esx_driver.c | 4 ++++ src/libvirt_private.syms | 1 + src/libxl/libxl_driver.c | 5 +++++ src/lxc/lxc_driver.c | 5 +++++ src/network/bridge_driver.c | 5 +++++ src/openvz/openvz_driver.c | 5 +++++ src/qemu/qemu_driver.c | 5 +++++ src/test/test_driver.c | 5 +++++ src/vz/vz_driver.c | 5 +++++ 12 files changed, 89 insertions(+) diff --git a/src/ch/ch_driver.c b/src/ch/ch_driver.c index a0ff687d05..ac9298c0b5 100644 --- a/src/ch/ch_driver.c +++ b/src/ch/ch_driver.c @@ -919,9 +919,14 @@ static int chConnectSupportsFeature(virConnectPtr conn, int feature) { + int supported; + if (virConnectSupportsFeatureEnsureACL(conn) < 0) return -1; + if (virDriverFeatureIsGlobal(feature, &supported)) + return supported; + switch ((virDrvFeature) feature) { case VIR_DRV_FEATURE_TYPED_PARAM_STRING: case VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER: diff --git a/src/driver.c b/src/driver.c index 9ae95cb4c3..8c70662ccb 100644 --- a/src/driver.c +++ b/src/driver.c @@ -316,3 +316,44 @@ virConnectValidateURIPath(const char *uriPath, return true; } + + +/** + * virDriverFeatureIsGlobal: + * @feat: a VIR_DRV_FEATURE + * @supported: If a feature is globally handled + * + * Certain driver feature flags are really not for individual drivers to d= ecide + * whether they implement them or not, but are rather global based on e.g. + * whether the RPC protocol supports it. + * + * This function returns 'true' and fills @supported if a feature is a glo= bal + * feature and the individual driver implementations don't decide whether + * they support it or not. + */ +bool +virDriverFeatureIsGlobal(virDrvFeature feat, + int *supported G_GNUC_UNUSED) + +{ + switch (feat) { + case VIR_DRV_FEATURE_TYPED_PARAM_STRING: + case VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER: + case VIR_DRV_FEATURE_FD_PASSING: + case VIR_DRV_FEATURE_MIGRATION_V2: + case VIR_DRV_FEATURE_MIGRATION_V3: + case VIR_DRV_FEATURE_MIGRATION_P2P: + case VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTION: + case VIR_DRV_FEATURE_XML_MIGRATABLE: + case VIR_DRV_FEATURE_MIGRATION_OFFLINE: + case VIR_DRV_FEATURE_MIGRATION_PARAMS: + case VIR_DRV_FEATURE_MIGRATION_DIRECT: + case VIR_DRV_FEATURE_MIGRATION_V1: + case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE: + case VIR_DRV_FEATURE_REMOTE: + case VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK: + case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK: + default: + return false; + } +} diff --git a/src/driver.h b/src/driver.h index 7f45231f24..cd7cd96844 100644 --- a/src/driver.h +++ b/src/driver.h @@ -131,3 +131,6 @@ int virSetConnectStorage(virConnectPtr conn); bool virConnectValidateURIPath(const char *uriPath, const char *entityName, bool privileged); + +bool virDriverFeatureIsGlobal(virDrvFeature feat, + int *supported); diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 467740804a..3149f3e963 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -1018,6 +1018,10 @@ esxConnectSupportsFeature(virConnectPtr conn, int fe= ature) { esxPrivate *priv =3D conn->privateData; esxVI_Boolean supportsVMotion =3D esxVI_Boolean_Undefined; + int supported; + + if (virDriverFeatureIsGlobal(feature, &supported)) + return supported; switch ((virDrvFeature) feature) { case VIR_DRV_FEATURE_MIGRATION_V1: diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 2380f02b88..6f0d72ca38 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1528,6 +1528,7 @@ virStreamClass; # driver.h virConnectValidateURIPath; +virDriverFeatureIsGlobal; virDriverShouldAutostart; virGetConnectInterface; virGetConnectNetwork; diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 4c61d330ed..478ab3e941 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -5697,9 +5697,14 @@ libxlConnectListAllDomains(virConnectPtr conn, static int libxlConnectSupportsFeature(virConnectPtr conn, int feature) { + int supported; + if (virConnectSupportsFeatureEnsureACL(conn) < 0) return -1; + if (virDriverFeatureIsGlobal(feature, &supported)) + return supported; + switch ((virDrvFeature) feature) { case VIR_DRV_FEATURE_MIGRATION_V3: case VIR_DRV_FEATURE_TYPED_PARAM_STRING: diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index ff83557bac..020ec257ae 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1618,9 +1618,14 @@ static int lxcStateCleanup(void) static int lxcConnectSupportsFeature(virConnectPtr conn, int feature) { + int supported; + if (virConnectSupportsFeatureEnsureACL(conn) < 0) return -1; + if (virDriverFeatureIsGlobal(feature, &supported)) + return supported; + switch ((virDrvFeature) feature) { case VIR_DRV_FEATURE_TYPED_PARAM_STRING: case VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER: diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 3750da7962..d6ae05360b 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -857,9 +857,14 @@ static int networkConnectIsAlive(virConnectPtr conn G_= GNUC_UNUSED) static int networkConnectSupportsFeature(virConnectPtr conn, int feature) { + int supported; + if (virConnectSupportsFeatureEnsureACL(conn) < 0) return -1; + if (virDriverFeatureIsGlobal(feature, &supported)) + return supported; + switch ((virDrvFeature) feature) { case VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER: return 1; diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index b2589059c8..aa1db09540 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -1938,6 +1938,11 @@ openvzNodeGetCPUMap(virConnectPtr conn G_GNUC_UNUSED, static int openvzConnectSupportsFeature(virConnectPtr conn G_GNUC_UNUSED, int feature) { + int supported; + + if (virDriverFeatureIsGlobal(feature, &supported)) + return supported; + switch ((virDrvFeature) feature) { case VIR_DRV_FEATURE_MIGRATION_PARAMS: case VIR_DRV_FEATURE_MIGRATION_V3: diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f2620200f0..f1f708e511 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1173,9 +1173,14 @@ static int qemuConnectClose(virConnectPtr conn) static int qemuConnectSupportsFeature(virConnectPtr conn, int feature) { + int supported; + if (virConnectSupportsFeatureEnsureACL(conn) < 0) return -1; + if (virDriverFeatureIsGlobal(feature, &supported)) + return supported; + switch ((virDrvFeature) feature) { case VIR_DRV_FEATURE_MIGRATION_V2: case VIR_DRV_FEATURE_MIGRATION_V3: diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 03c41ca192..4eca5c4a65 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1667,6 +1667,11 @@ static int testConnectSupportsFeature(virConnectPtr conn G_GNUC_UNUSED, int feature) { + int supported; + + if (virDriverFeatureIsGlobal(feature, &supported)) + return supported; + switch ((virDrvFeature) feature) { case VIR_DRV_FEATURE_TYPED_PARAM_STRING: case VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER: diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 86bc53d631..fc91b6dddf 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -3006,9 +3006,14 @@ vzDomainMigratePrepare3Params(virConnectPtr conn, static int vzConnectSupportsFeature(virConnectPtr conn G_GNUC_UNUSED, int feature) { + int supported; + if (virConnectSupportsFeatureEnsureACL(conn) < 0) return -1; + if (virDriverFeatureIsGlobal(feature, &supported)) + return supported; + switch ((virDrvFeature) feature) { case VIR_DRV_FEATURE_MIGRATION_PARAMS: case VIR_DRV_FEATURE_MIGRATION_P2P: --=20 2.35.1 From nobody Tue May 14 21:21:05 2024 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=1645026113; cv=none; d=zohomail.com; s=zohoarc; b=BGpk2RPUrGcaWYKCVJ1lwbIkc4dvoc86ybc+kjVjqkwaQTNFDF5rrVNddkaHGCcaE7sSrqfPtNEb9bzaSoEX+UgFhAx8Lt1PImd9WoSopSZbjpO4lHaPBW/smyqAvdbTmxRV0z6yBMzpZgINVxLUtFOuckwcb/hld6GfJiCkz4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645026113; 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=nGTLDkOz2ShXpfNJ1N8/cmPmm5Y74RIGc4cCFGdLo0I=; b=fDave63F2dukUUWi7gLAjXduNH6SXIEa+ABb4OkBYHu9+cAQWlliVco8QhvQnYN6RRnbuBnL5MsaesrvHT/B+60dvUE+7S/OW8iS1vz75Ts+/ny/lKw5UVlmA/4SOUXCqGPZOogo3K/iecmgvb7pOSXquukOUdFkDkOBJM8hwDk= 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 1645026113070658.0875560076759; Wed, 16 Feb 2022 07:41:53 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-627-12SyjxbWMYabMIY754oDyg-1; Wed, 16 Feb 2022 10:41:43 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 642542F51; Wed, 16 Feb 2022 15:41:37 +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 4177D7D725; Wed, 16 Feb 2022 15:41:37 +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 13AB21802E38; Wed, 16 Feb 2022 15:41:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21GFfNvX021096 for ; Wed, 16 Feb 2022 10:41:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id AB03774E95; Wed, 16 Feb 2022 15:41:23 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id EED3F74E8A for ; Wed, 16 Feb 2022 15:41:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645026111; 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=nGTLDkOz2ShXpfNJ1N8/cmPmm5Y74RIGc4cCFGdLo0I=; b=FES9pepEBPObXVei8I6BSSL2UcPrP6B3NomAP8piDn3SVQpVmtGLDllfRwsKgysJuKuE2w jCVv3G9P/6I6zjep0F8vI04CSaccqITjHPIJGtlnA8hsex8UCaye/qenfhWUR//MVCz2OZ VPeBaI0M9+6+h1Mz05POnz44TxKmnuM= X-MC-Unique: 12SyjxbWMYabMIY754oDyg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/8] virDriverFeatureIsGlobal: Handle VIR_DRV_FEATURE_REMOTE Date: Wed, 16 Feb 2022 16:41:06 +0100 Message-Id: <5f7961950d678a2228ff226fbe9ae1f22456524a.1645026017.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.13 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: 1645026114957100003 Content-Type: text/plain; charset="utf-8" VIR_DRV_FEATURE_REMOTE is a special flag which is asserted only when the connection is remote. All drivers implementing it must return 0 for it to work. Handle it in the global handler and add a comment why. Signed-off-by: Peter Krempa Reviewed-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/driver.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/driver.c b/src/driver.c index 8c70662ccb..b450400084 100644 --- a/src/driver.c +++ b/src/driver.c @@ -333,10 +333,18 @@ virConnectValidateURIPath(const char *uriPath, */ bool virDriverFeatureIsGlobal(virDrvFeature feat, - int *supported G_GNUC_UNUSED) + int *supported) { switch (feat) { + /* This is a special case where the generated remote driver dispatcher + * function intercepts this specific flag and returns '1'. Thus any lo= cal + * implementation must return 0, so that the return value properly ref= lects + * whether we are going through the remote driver */ + case VIR_DRV_FEATURE_REMOTE: + *supported =3D 0; + return true; + case VIR_DRV_FEATURE_TYPED_PARAM_STRING: case VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER: case VIR_DRV_FEATURE_FD_PASSING: @@ -350,7 +358,6 @@ virDriverFeatureIsGlobal(virDrvFeature feat, case VIR_DRV_FEATURE_MIGRATION_DIRECT: case VIR_DRV_FEATURE_MIGRATION_V1: case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE: - case VIR_DRV_FEATURE_REMOTE: case VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK: case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK: default: --=20 2.35.1 From nobody Tue May 14 21:21:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1645026184; cv=none; d=zohomail.com; s=zohoarc; b=bajonJShpys9WckD06qjmSCl17WtlDhHjld+WcDrEpn8QJR0UEVNn858Ykhxk4V1b3USnQBDoFINKhpyQZS61UJ1bOZJtAMFt/T27HE1Zx3WDtWkS9vZB3k7JlINLiafSf7ejuYVFRb7laoMvz+GmO9zhYhOOflN+bNFrMdIZyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645026184; 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=qtl28DWajd+uQiUqEHDXbMyOaCWEpGfkqhFRriXoaLc=; b=GORgIDDaQqusgS0bkac2spFHA2mY5ZIrgMv3vrKf+vkAluC8WHCLYNlq7UtIgtSdjISAud81rhbyCjBEpVySietc1aPhVeXOdsKE3Wj4d/XkJ9wg0cwlZ80XPUvOOof1fo/L7nf94YGm4tuVgKtQZ9zSVBuRZ/W2eBY0C7rg+RE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1645026184783278.35694711195265; Wed, 16 Feb 2022 07:43:04 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-47-8OefEKKgMBWO_vGZJMrH4g-1; Wed, 16 Feb 2022 10:41:45 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 256C98144E2; Wed, 16 Feb 2022 15:41:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 054337B9E4; Wed, 16 Feb 2022 15:41:40 +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 CAEC84BB7C; Wed, 16 Feb 2022 15:41:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21GFfOJC021126 for ; Wed, 16 Feb 2022 10:41:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id CA96074E8A; Wed, 16 Feb 2022 15:41:24 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 180C474E97 for ; Wed, 16 Feb 2022 15:41:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645026184; 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=qtl28DWajd+uQiUqEHDXbMyOaCWEpGfkqhFRriXoaLc=; b=DXkFg8uPpolvz4H0V/5Uuaarc7C/WEQbLQZxByx9TiQjOiEJDma28eW1ANGuiA1OKabGBw 7qZwEl1/bB1lmY97ZQBHZWeOBxgJurvyyMA/9Yr04OlJho9YlIgBpvJ6/clUV7Hx77L5uh AwvJ4VfKLWqZO5QYFKPXiwH33nDtG4U= X-MC-Unique: 8OefEKKgMBWO_vGZJMrH4g-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/8] virDriverFeatureIsGlobal: Handle VIR_DRV_FEATURE_PROGRAM_KEEPALIVE Date: Wed, 16 Feb 2022 16:41:07 +0100 Message-Id: <09225313378849550b2a311564c4eda5e43bcef8.1645026017.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.12 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: 1645026201636100005 Content-Type: text/plain; charset="utf-8" keepalive is a RPC feature, drivers must say that it's not supported. Signed-off-by: Peter Krempa Reviewed-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/driver.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/driver.c b/src/driver.c index b450400084..6bebfeba58 100644 --- a/src/driver.c +++ b/src/driver.c @@ -342,6 +342,9 @@ virDriverFeatureIsGlobal(virDrvFeature feat, * implementation must return 0, so that the return value properly ref= lects * whether we are going through the remote driver */ case VIR_DRV_FEATURE_REMOTE: + /* keepalive is handled at RPC level, driver implementations must alwa= ys + * return 0, to signal that direct/embedded use doesn't use keepalive = */ + case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE: *supported =3D 0; return true; @@ -357,7 +360,6 @@ virDriverFeatureIsGlobal(virDrvFeature feat, case VIR_DRV_FEATURE_MIGRATION_PARAMS: case VIR_DRV_FEATURE_MIGRATION_DIRECT: case VIR_DRV_FEATURE_MIGRATION_V1: - case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE: case VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK: case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK: default: --=20 2.35.1 From nobody Tue May 14 21:21:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1645026097; cv=none; d=zohomail.com; s=zohoarc; b=ktIDc3ANLrt+Ia27fJl11bDeRqWcFOlqpaXX9jaGAwhJKQTbKIMEWH8Y4LKs0dJPzxJuFGEHJHRAWmA94yIfLNkxw/gsFnbQupLKEYDV4h3D3nwxHp0auhyBbnczauh1TeB/qvosmg1enTOoPgF7A8FvgSO/gzU9pDsPgu7GUrU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645026097; 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=KzC49NQmEZz40raNTuUWAceqliZmyW5naGepDEtREM8=; b=VjEwUz0KPVsSCr1rh051fiWfv1qfeU/9+BI3NvcMe1GXIZ2gZ8Mgsr15pU3ccpRaqiTzxIYg42nhvzbTE27XJybUwccCKYm2kHx0h4Bfwzvk9o2uy8TCGUoeT+1GerZ5lpUY/KQbMW2OmCUnQsCFhLSIicdmY1qXmJuW137gBjg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1645026097331461.412318260637; Wed, 16 Feb 2022 07:41:37 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-150-sZ6fZYSkP7S3y_1uqEcXCg-1; Wed, 16 Feb 2022 10:41:32 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0050F1853022; Wed, 16 Feb 2022 15:41:28 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C16C874E94; Wed, 16 Feb 2022 15:41:27 +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 CD8214A708; Wed, 16 Feb 2022 15:41:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21GFfP67021148 for ; Wed, 16 Feb 2022 10:41:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id D98C274E98; Wed, 16 Feb 2022 15:41:25 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43A3C74E97 for ; Wed, 16 Feb 2022 15:41:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645026096; 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=KzC49NQmEZz40raNTuUWAceqliZmyW5naGepDEtREM8=; b=fh4LWZUCkeGE0rrNmTXbjRuaA8KTk6F1gwCg3pR6vGR2PZaaQ/wtB7VNVzuBJTj8u56zXu W+n/IUDYHfg9dmFL1PeA9VnlGK0eeyEPAloGwhdms0vYc+IrJHHfStHOx10XbTS68TVqT5 YyOeu1BsTLRKF4CkTvz5jnksXfDX9Yo= X-MC-Unique: sZ6fZYSkP7S3y_1uqEcXCg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/8] virDriverFeatureIsGlobal: Handle VIR_DRV_FEATURE_REMOTE_(CLOSE|EVENT)_CALLBACK Date: Wed, 16 Feb 2022 16:41:08 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.15 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: 1645026099079100001 Content-Type: text/plain; charset="utf-8" They are features of the RPC; drivers must say that it's not supported. Signed-off-by: Peter Krempa Reviewed-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/driver.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/driver.c b/src/driver.c index 6bebfeba58..9852a1cb17 100644 --- a/src/driver.c +++ b/src/driver.c @@ -345,6 +345,11 @@ virDriverFeatureIsGlobal(virDrvFeature feat, /* keepalive is handled at RPC level, driver implementations must alwa= ys * return 0, to signal that direct/embedded use doesn't use keepalive = */ case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE: + /* Support for close callbacks and remote event filtering are both fea= tures + * of the RPC protocol and thus normal drivers must not signal support + * for them. */ + case VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK: + case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK: *supported =3D 0; return true; @@ -360,8 +365,6 @@ virDriverFeatureIsGlobal(virDrvFeature feat, case VIR_DRV_FEATURE_MIGRATION_PARAMS: case VIR_DRV_FEATURE_MIGRATION_DIRECT: case VIR_DRV_FEATURE_MIGRATION_V1: - case VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK: - case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK: default: return false; } --=20 2.35.1 From nobody Tue May 14 21:21:05 2024 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=1645026147; cv=none; d=zohomail.com; s=zohoarc; b=W7wffNjxCjfd6bMyThkXKLsC1JHswI7HhmeOZi+vGI1VLaxvirII/F4jeDkqaWYUIUxusE6GOwieiNFN9Rmf6+ANYb7gK595V/k2l4iWwhQtJac8cZWExjnGZwddcEWYGVKOCtAEPJN1koWgnGnwpP7wMCB+XHmaFdJ9NNxOTlE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645026147; 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=7IMrs50jxGj+r4l8eSxhmhxe3ThEq5Y3a0P2WpJDs44=; b=HC18PnvvbJpkqTQpjUzjtJ5bG8oDFAmG808QuvBLJZWCgg192d9zIjb+HrP04GrgSumyOxSWSSmuzo2XYWCI7nipe1L3m74nmUesRC6Q8EeCqATtn3Munva60kKkPyzP4pKvyAR5eY2LKx4hJCytjdaDUMH7ujqLDkRwYk4h1n0= 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 1645026147517457.94486979289013; Wed, 16 Feb 2022 07:42:27 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-673-SK4RVnhoPX6d3Fk7CEWvBg-1; Wed, 16 Feb 2022 10:42:26 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 46114835B91; Wed, 16 Feb 2022 15:42:21 +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 24C107B9E3; Wed, 16 Feb 2022 15:42:21 +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 E78E5180126E; Wed, 16 Feb 2022 15:42:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21GFfRDH021176 for ; Wed, 16 Feb 2022 10:41:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0A9C074E8C; Wed, 16 Feb 2022 15:41:27 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59C7D74E97 for ; Wed, 16 Feb 2022 15:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645026147; 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=7IMrs50jxGj+r4l8eSxhmhxe3ThEq5Y3a0P2WpJDs44=; b=VruXoFza5qNgGxF6PwAN2cmZ6nXX/0v1No3/ecnhHpTgRQ/8/IOHwRndxLBzp16Qgbls2E iEDUnRfw5sASN2Ive5E/BWuulkl9uSXrGSVZn3pORDPsVGOW9Y5Z72NrYt9zioZ4C3+VKn w4Vssu+hPGi11dR3S0SE9FMsBUv3W4w= X-MC-Unique: SK4RVnhoPX6d3Fk7CEWvBg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/8] virDriverFeatureIsGlobal: Handle VIR_DRV_FEATURE_TYPED_PARAM_STRING Date: Wed, 16 Feb 2022 16:41:09 +0100 Message-Id: <39837e0fab91d5119ca8fffe6332c80b873de99a.1645026017.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.12 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: 1645026149228100003 Content-Type: text/plain; charset="utf-8" This was a lockout to make strings in typed parameters compatible with versions which didn't have them. Now all drivers need to expose this capability. This namely enables it for 'esx' and 'vz' drivers, while they don't seem to be implementing any parameters for now, they might later. Signed-off-by: Peter Krempa Reviewed-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/driver.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/driver.c b/src/driver.c index 9852a1cb17..d070861cfd 100644 --- a/src/driver.c +++ b/src/driver.c @@ -353,7 +353,13 @@ virDriverFeatureIsGlobal(virDrvFeature feat, *supported =3D 0; return true; + /* Limitation of string support in typed parameters was an RPC limitat= ion. + * At this point everything supports them and thus also drivers need to + * always advertise this feature */ case VIR_DRV_FEATURE_TYPED_PARAM_STRING: + *supported =3D 1; + return true; + case VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER: case VIR_DRV_FEATURE_FD_PASSING: case VIR_DRV_FEATURE_MIGRATION_V2: --=20 2.35.1 From nobody Tue May 14 21:21:05 2024 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=1645026103; cv=none; d=zohomail.com; s=zohoarc; b=Uv3JD09qnrVNsB7qHRTEa6CokPeIiLOkmyxFdnE0Y0vyabM/8V+vXxR7bO+rrPVIONxWqckmOomeozZ5ZpQjm+EnD/GBqoY8IlhQPkYlWj6X82S8cUqoye39UnBrE1xqmbygrqGuOBEBk91uXAHL1LsoGB64jJOXr41a7kdpnns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645026103; 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=PidDDwV86Dg9HdOp3D2VUxAyFgUzzFoBtjNs1g6ER9k=; b=KgJxt+Cvuax3YHvQX7TDtaoaymoJOxrYJNm8ZoAJNphwLDQxhKOnmQ4ffeSoOvokKuJ1FP2iKtyQq+FV7XTRBPxhBf7YwnzH3hGkD0ofLpAC1JzJUh+0kiE2UpIzlZ1+hTYTDAlV9PJaBUa6iftXtYN+kQgWW/hw6ZP/wavH8z0= 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 16450261036054.871751110375158; Wed, 16 Feb 2022 07:41:43 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-295-DvYp7tMSOhGozw9RQoqB2A-1; Wed, 16 Feb 2022 10:41:35 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E4FF6802925; Wed, 16 Feb 2022 15:41:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C22397DE42; Wed, 16 Feb 2022 15:41:29 +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 8F43D4A70E; Wed, 16 Feb 2022 15:41:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21GFfSns021197 for ; Wed, 16 Feb 2022 10:41:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1D29A74E94; Wed, 16 Feb 2022 15:41:28 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79B1174E8C for ; Wed, 16 Feb 2022 15:41:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645026103; 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=PidDDwV86Dg9HdOp3D2VUxAyFgUzzFoBtjNs1g6ER9k=; b=ZLFI254JqPMcMD2gMsZJItOD5eo+gDVJttlK+V0PqR/7kYMqzCc0VtoKIF4dnh4ckrBfRn 20qNVsBHp8fk3S0Ayy9Sy4S2ISWtd2nYmQGHtY9YsRzMulVOY12hEs1DDCnchRDsNRtbUA HXHeYzjFMPR/clECzC1Whu1fd5PBj98= X-MC-Unique: DvYp7tMSOhGozw9RQoqB2A-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/8] virDriverFeatureIsGlobal: Handle VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER Date: Wed, 16 Feb 2022 16:41:10 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.16 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: 1645026112044100005 Content-Type: text/plain; charset="utf-8" The fix was on RPC level so everything should advertise it. Signed-off-by: Peter Krempa Reviewed-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/driver.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/driver.c b/src/driver.c index d070861cfd..54b4ad5b43 100644 --- a/src/driver.c +++ b/src/driver.c @@ -357,10 +357,12 @@ virDriverFeatureIsGlobal(virDrvFeature feat, * At this point everything supports them and thus also drivers need to * always advertise this feature */ case VIR_DRV_FEATURE_TYPED_PARAM_STRING: + /* Feature flag exposes that accidental switching of order of arguments + * in RPC was fixed. All implementations need to advertise this featur= e */ + case VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER: *supported =3D 1; return true; - case VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER: case VIR_DRV_FEATURE_FD_PASSING: case VIR_DRV_FEATURE_MIGRATION_V2: case VIR_DRV_FEATURE_MIGRATION_V3: --=20 2.35.1 From nobody Tue May 14 21:21:05 2024 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=1645026109; cv=none; d=zohomail.com; s=zohoarc; b=SGhIswCC4mOtv4hjLlpXMX5Sda0bb+auMqFRRS9SN/LITcNEm96aq6tpWS6nMltxTT41hWePbZta0LmCqIjWn4TZ1fT727DABYGUX62VAS2/LzTespCU/VsXCZeeDYPEB3eQKjuLKKJ+BtPWZGscD9QyoDL0OAPoTNcxT7do5nM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645026109; 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=jmkk/NvLjA53coi87wZcLn0tlzInrQKIfDYewHVUxkw=; b=g2lvLuOGbw4vy7dCnDNSRG2/pPjP5pSsaVHHbRmLg2ySQ4L2kyhdK61dg8ZB7J5aUwpojJBELccqKqscy/APnvssZ4Vk60cBTWBmkmohstOlrmJecGh46YSmNirqfe03qKr0gLHyvB9MH9fHoAFdpwm5c4mU4NT8AkcWyDIZ+Xg= 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 1645026109660407.0354079060837; Wed, 16 Feb 2022 07:41:49 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-413-mJKeDpT9PoS95h1U87Zseg-1; Wed, 16 Feb 2022 10:41:39 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8CB8B2F44; Wed, 16 Feb 2022 15:41:34 +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 6AAB14699F; Wed, 16 Feb 2022 15:41:34 +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 3B7DD1802FE9; Wed, 16 Feb 2022 15:41:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21GFfUQg021214 for ; Wed, 16 Feb 2022 10:41:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id A9E5874E8C; Wed, 16 Feb 2022 15:41:30 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0CD1574EA0 for ; Wed, 16 Feb 2022 15:41:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645026108; 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=jmkk/NvLjA53coi87wZcLn0tlzInrQKIfDYewHVUxkw=; b=KbJph0weRCMiFoLPj6GzfesR+SFEzXShzqF+HmuT3XgAz/PqmDoDhSzSLz5cX8YbGuToWG 74CA8+pXjEA/6fp8JAEVujGe6N1vrolHT29bhFYMsnHeB2KESS5b0Q6JCUEKY9XPySYwHi pfHFxRr8dEZRCVB3jiqHYJJjyD5ARFQ= X-MC-Unique: mJKeDpT9PoS95h1U87Zseg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 7/8] virDriverFeatureIsGlobal: Handle VIR_DRV_FEATURE_FD_PASSING Date: Wed, 16 Feb 2022 16:41:11 +0100 Message-Id: <692be366a27f3cee43443a36f17794536d2d429e.1645026017.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.12 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: 1645026110931100001 Content-Type: text/plain; charset="utf-8" The feature implies that fd passing works with RPC. Non-remote impls thus should always report support. Signed-off-by: Peter Krempa Reviewed-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/driver.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/driver.c b/src/driver.c index 54b4ad5b43..758ee3e320 100644 --- a/src/driver.c +++ b/src/driver.c @@ -360,10 +360,14 @@ virDriverFeatureIsGlobal(virDrvFeature feat, /* Feature flag exposes that accidental switching of order of arguments * in RPC was fixed. All implementations need to advertise this featur= e */ case VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER: + /* The remote driver intercepts and always reports the feature since i= t was + * introduced. This means that all driver implementations should adver= tise + * it too as it works natively without RPC. Always enabling this will = also + * prevent regressions when a driver is used in embedded mode */ + case VIR_DRV_FEATURE_FD_PASSING: *supported =3D 1; return true; - case VIR_DRV_FEATURE_FD_PASSING: case VIR_DRV_FEATURE_MIGRATION_V2: case VIR_DRV_FEATURE_MIGRATION_V3: case VIR_DRV_FEATURE_MIGRATION_P2P: --=20 2.35.1 From nobody Tue May 14 21:21:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1645026153; cv=none; d=zohomail.com; s=zohoarc; b=Imm1K6F64MukInbANVaVAx26suQ6oNeN99kcJwtIZdiZEeGjKgkLyZCMxhpvBd/Gchp8Y12d3k8NnPngYU1ZnM1BWfpad0TokKWUK2+Tncr92pK8SE1jqudH9boZd8RhrXTcfbE6WVQ/Afp1iG78B781MKeXWHgYRd+5t/Y5Duc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645026153; 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=8HetV6i7MCZnFURFxkz7usTrW9xkdWsLy2qzZa5g9OI=; b=JXoKdl8woCdemybDrLMP4MzQ9m1MFY4nU+/rJzxo5krOj8sZKpUe97qBVeuGQ4DuFFUFewjbDVDmV/q769gxqtn0xdDSg7B44pFrfjQxH7c2yxlnwT+v6DKckjyctlcyZdcbLdGHOLYfAi46Bi0w/MogkImgfnSV7SpIeEDBqCo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1645026153679649.7537507572162; Wed, 16 Feb 2022 07:42:33 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-96-HWK2tM9uNCG0qINrWr5KCg-1; Wed, 16 Feb 2022 10:42:31 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3E8278144E6; Wed, 16 Feb 2022 15:42:24 +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 1A4D82B6FE; Wed, 16 Feb 2022 15:42:24 +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 DCCA8180126E; Wed, 16 Feb 2022 15:42:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21GFfVES021225 for ; Wed, 16 Feb 2022 10:41:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id D384E74E95; Wed, 16 Feb 2022 15:41:31 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CA7D74E8A for ; Wed, 16 Feb 2022 15:41:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645026152; 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=8HetV6i7MCZnFURFxkz7usTrW9xkdWsLy2qzZa5g9OI=; b=DYtbJOcLac76IPRtHYIBiKL4oRXXNgLS30eqPqzgpBQbX9Yk8+dSPZHgsiBeCwRZrPGmZi 169mAgAtRHc7SgNgFalHHK6glZ7/tKoqcvQHb4ppoVONYDaH/Ym1k1u3D3KeoEtuBewyUC o1hXMohl8HgDQwHdMMNLm0l3QKLNtr4= X-MC-Unique: HWK2tM9uNCG0qINrWr5KCg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 8/8] virDomainCreate(XML)WithFiles: Add check for VIR_DRV_FEATURE_FD_PASSING Date: Wed, 16 Feb 2022 16:41:12 +0100 Message-Id: <4ea1b7ea8fae8c7702ed4570b879600b51d4bce7.1645026017.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.84 on 10.5.11.23 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: 1645026155279100001 Content-Type: text/plain; charset="utf-8" All APIs using FD passing have this check to prevent sending a 'VIR_NET_CALL_WITH_FDS' to an older daemon but virDomainCreateXMLWithFiles was missing it. Now the LXC driver was historically not exposing VIR_DRV_FEATURE_FD_PASSING, but that is not a problem as LXC always goes through the remote driver which intercepts it and injects VIR_DRV_FEATURE_FD_PASSING when it was implemented. Signed-off-by: Peter Krempa Reviewed-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- src/libvirt-domain.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index b8a6f10333..8be2c21194 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -244,6 +244,18 @@ virDomainCreateXMLWithFiles(virConnectPtr conn, const = char *xmlDesc, virCheckNonNullArgGoto(xmlDesc, error); virCheckReadOnlyGoto(conn->flags, error); + if (nfiles > 0) { + int rc; + + if ((rc =3D VIR_DRV_SUPPORTS_FEATURE(conn->driver, conn, + VIR_DRV_FEATURE_FD_PASSING)) <= =3D 0) { + if (rc =3D=3D 0) + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("fd passing is not supported by this conn= ection")); + goto error; + } + } + if (conn->driver->domainCreateXMLWithFiles) { virDomainPtr ret; ret =3D conn->driver->domainCreateXMLWithFiles(conn, xmlDesc, @@ -6869,6 +6881,18 @@ virDomainCreateWithFiles(virDomainPtr domain, unsign= ed int nfiles, virCheckReadOnlyGoto(conn->flags, error); + if (nfiles > 0) { + int rc; + + if ((rc =3D VIR_DRV_SUPPORTS_FEATURE(conn->driver, conn, + VIR_DRV_FEATURE_FD_PASSING)) <= =3D 0) { + if (rc =3D=3D 0) + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("fd passing is not supported by this conn= ection")); + goto error; + } + } + if (conn->driver->domainCreateWithFiles) { int ret; ret =3D conn->driver->domainCreateWithFiles(domain, --=20 2.35.1