]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: block: Drop code for 'vxhs' storage protocol
authorPeter Krempa <pkrempa@redhat.com>
Sun, 25 May 2025 06:18:21 +0000 (08:18 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 3 Jun 2025 11:11:02 +0000 (13:11 +0200)
qemu-5.2 dropped support for the 'vxhs' protocol. We require qemu-5.2
since commit ce48d584cc4 and thus the block code for vxhs is now dead.
Remove it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_block.c
src/qemu/qemu_domain.c

index b1f50b6c676ae0989023e427c952f931823f5fb1..32568d4ae6ce93adc72b93458ddf438cbd3b18b2 100644 (file)
@@ -426,41 +426,6 @@ qemuBlockStorageSourceGetGlusterProps(virStorageSource *src,
 }
 
 
-static virJSONValue *
-qemuBlockStorageSourceGetVxHSProps(virStorageSource *src,
-                                   bool onlytarget)
-{
-    g_autoptr(virJSONValue) server = NULL;
-    const char *tlsAlias = src->tlsAlias;
-    virJSONValue *ret = NULL;
-
-    if (src->nhosts != 1) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("VxHS protocol accepts only one host"));
-        return NULL;
-    }
-
-    if (!(server = qemuBlockStorageSourceBuildJSONInetSocketAddress(&src->hosts[0])))
-        return NULL;
-
-    if (onlytarget)
-        tlsAlias = NULL;
-
-    /* VxHS disk specification example:
-     * { driver:"vxhs",
-     *   tls-creds:"objvirtio-disk0_tls0",
-     *   vdisk-id:"eb90327c-8302-4725-4e85ed4dc251",
-     *   server:{type:"tcp", host:"1.2.3.4", port:9999}}
-     */
-    ignore_value(virJSONValueObjectAdd(&ret,
-                                       "S:tls-creds", tlsAlias,
-                                       "s:vdisk-id", src->path,
-                                       "a:server", &server, NULL));
-
-    return ret;
-}
-
-
 static virJSONValue *
 qemuBlockStorageSourceGetNFSProps(virStorageSource *src)
 {
@@ -1088,11 +1053,6 @@ qemuBlockStorageSourceGetBackendProps(virStorageSource *src,
                 return NULL;
             break;
 
-        case VIR_STORAGE_NET_PROTOCOL_VXHS:
-            driver = "vxhs";
-            if (!(fileprops = qemuBlockStorageSourceGetVxHSProps(src, onlytarget)))
-                return NULL;
-            break;
 
         case VIR_STORAGE_NET_PROTOCOL_HTTP:
         case VIR_STORAGE_NET_PROTOCOL_HTTPS:
@@ -1134,6 +1094,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSource *src,
                 return NULL;
             break;
 
+        case VIR_STORAGE_NET_PROTOCOL_VXHS:
         case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG:
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                            _("unsupported disk protocol"));
index 230dc860380ce8780f18db269722e7d2a87f1db8..ace42b516acdefd14d8afccdc57e043fdaad3d2e 100644 (file)
@@ -8798,40 +8798,6 @@ qemuDomainPrepareChardevSourceOne(virDomainDeviceDef *dev,
 }
 
 
-static int
-qemuProcessPrepareStorageSourceTLSVxhs(virStorageSource *src,
-                                       virQEMUDriverConfig *cfg,
-                                       qemuDomainObjPrivate *priv,
-                                       const char *parentAlias)
-{
-    /* VxHS uses only client certificates and thus has no need for
-     * the server-key.pem nor a secret that could be used to decrypt
-     * the it, so no need to add a secinfo for a secret UUID. */
-    if (src->haveTLS == VIR_TRISTATE_BOOL_ABSENT) {
-        if (cfg->vxhsTLS)
-            src->haveTLS = VIR_TRISTATE_BOOL_YES;
-        else
-            src->haveTLS = VIR_TRISTATE_BOOL_NO;
-        src->tlsFromConfig = true;
-    }
-
-    if (src->haveTLS == VIR_TRISTATE_BOOL_YES) {
-        src->tlsAlias = qemuAliasTLSObjFromSrcAlias(parentAlias);
-        src->tlsCertdir = g_strdup(cfg->vxhsTLSx509certdir);
-
-        if (cfg->vxhsTLSx509secretUUID) {
-            qemuDomainStorageSourcePrivate *srcpriv = qemuDomainStorageSourcePrivateFetch(src);
-
-            if (!(srcpriv->tlsKeySecret = qemuDomainSecretInfoTLSNew(priv, src->tlsAlias,
-                                                                     cfg->vxhsTLSx509secretUUID)))
-                return -1;
-        }
-    }
-
-    return 0;
-}
-
-
 static int
 qemuProcessPrepareStorageSourceTLSNBD(virStorageSource *src,
                                       virQEMUDriverConfig *cfg,
@@ -8958,8 +8924,7 @@ qemuDomainPrepareStorageSourceTLS(virStorageSource *src,
 
     switch ((virStorageNetProtocol) src->protocol) {
     case VIR_STORAGE_NET_PROTOCOL_VXHS:
-        if (qemuProcessPrepareStorageSourceTLSVxhs(src, cfg, priv, parentAlias) < 0)
-            return -1;
+        /* vxhs is no longer supported */
         break;
 
     case VIR_STORAGE_NET_PROTOCOL_NBD: