]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: storage: Add 'ssh' network storage protocol
authorPeter Krempa <pkrempa@redhat.com>
Tue, 9 Sep 2014 15:56:04 +0000 (17:56 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 27 Jul 2016 11:24:20 +0000 (13:24 +0200)
Allow using 'ssh' protocol in backing chains and later for disks
themselves.

src/libxl/libxl_conf.c
src/qemu/qemu_command.c
src/qemu/qemu_driver.c
src/qemu/qemu_parse_command.c
src/util/virstoragefile.c
src/util/virstoragefile.h
src/xenconfig/xen_xl.c

index 146e08afacc9976aa50c991486d1a651e84cd81b..2d6d5da4c77105205311f68b7f81012a1176e276 100644 (file)
@@ -581,6 +581,7 @@ libxlMakeNetworkDiskSrcStr(virStorageSourcePtr src,
     case VIR_STORAGE_NET_PROTOCOL_ISCSI:
     case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
     case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG:
+    case VIR_STORAGE_NET_PROTOCOL_SSH:
     case VIR_STORAGE_NET_PROTOCOL_LAST:
     case VIR_STORAGE_NET_PROTOCOL_NONE:
         virReportError(VIR_ERR_NO_SUPPORT,
index 3dc131b3dac26d5d50b1f827239f0e4c4c3fda90..5ac072510469cc38b1e09afc313694cce8b08a2c 100644 (file)
@@ -480,6 +480,9 @@ qemuNetworkDriveGetPort(int protocol,
         case VIR_STORAGE_NET_PROTOCOL_NBD:
             return 10809;
 
+        case VIR_STORAGE_NET_PROTOCOL_SSH:
+            return 22;
+
         case VIR_STORAGE_NET_PROTOCOL_ISCSI:
         case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
             /* no default port specified */
@@ -878,6 +881,10 @@ qemuBuildNetworkDriveURI(virStorageSourcePtr src,
             ret = virBufferContentAndReset(&buf);
             break;
 
+        case VIR_STORAGE_NET_PROTOCOL_SSH:
+            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                           _("'ssh' protocol is not yet supported"));
+            goto cleanup;
 
         case VIR_STORAGE_NET_PROTOCOL_LAST:
         case VIR_STORAGE_NET_PROTOCOL_NONE:
index f07526f143fe6ebba4c7a7c6d4849a65e67d7a20..1820f8558a15f3822db917aabac1e7a91079b485 100644 (file)
@@ -13373,6 +13373,7 @@ qemuDomainSnapshotPrepareDiskExternalBackingInactive(virDomainDiskDefPtr disk)
         case VIR_STORAGE_NET_PROTOCOL_FTP:
         case VIR_STORAGE_NET_PROTOCOL_FTPS:
         case VIR_STORAGE_NET_PROTOCOL_TFTP:
+        case VIR_STORAGE_NET_PROTOCOL_SSH:
         case VIR_STORAGE_NET_PROTOCOL_LAST:
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("external inactive snapshots are not supported on "
@@ -13435,6 +13436,7 @@ qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr d
         case VIR_STORAGE_NET_PROTOCOL_FTP:
         case VIR_STORAGE_NET_PROTOCOL_FTPS:
         case VIR_STORAGE_NET_PROTOCOL_TFTP:
+        case VIR_STORAGE_NET_PROTOCOL_SSH:
         case VIR_STORAGE_NET_PROTOCOL_LAST:
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("external active snapshots are not supported on "
@@ -13579,6 +13581,7 @@ qemuDomainSnapshotPrepareDiskInternal(virConnectPtr conn,
         case VIR_STORAGE_NET_PROTOCOL_FTP:
         case VIR_STORAGE_NET_PROTOCOL_FTPS:
         case VIR_STORAGE_NET_PROTOCOL_TFTP:
+        case VIR_STORAGE_NET_PROTOCOL_SSH:
         case VIR_STORAGE_NET_PROTOCOL_LAST:
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("internal inactive snapshots are not supported on "
index 3f7e44513c2e4b3fbde0fc9ab6b89a56ea77f20f..82d16214124efba244bf5a830485d2d6845fec92 100644 (file)
@@ -2014,6 +2014,7 @@ qemuParseCommandLine(virCapsPtr caps,
                 case VIR_STORAGE_NET_PROTOCOL_FTP:
                 case VIR_STORAGE_NET_PROTOCOL_FTPS:
                 case VIR_STORAGE_NET_PROTOCOL_TFTP:
+                case VIR_STORAGE_NET_PROTOCOL_SSH:
                 case VIR_STORAGE_NET_PROTOCOL_LAST:
                 case VIR_STORAGE_NET_PROTOCOL_NONE:
                     /* ignored for now */
index 169d70ec8a8cf6d27b84943cce1c1c90703a554a..3e22b0c848a61024ba36b2de02484182ffe78591 100644 (file)
@@ -84,7 +84,8 @@ VIR_ENUM_IMPL(virStorageNetProtocol, VIR_STORAGE_NET_PROTOCOL_LAST,
               "https",
               "ftp",
               "ftps",
-              "tftp")
+              "tftp",
+              "ssh")
 
 VIR_ENUM_IMPL(virStorageNetHostTransport, VIR_STORAGE_NET_HOST_TRANS_LAST,
               "tcp",
@@ -2501,6 +2502,7 @@ virStorageSourceParseBackingColon(virStorageSourcePtr src,
     case VIR_STORAGE_NET_PROTOCOL_TFTP:
     case VIR_STORAGE_NET_PROTOCOL_ISCSI:
     case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
+    case VIR_STORAGE_NET_PROTOCOL_SSH:
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("malformed backing store path for protocol %s"),
                        protocol);
index 1a76fad0f6f8692b74d1e86f2f751fbf2391d731..3ea3a60dfbdde2508c310d7724d8180e63c0512c 100644 (file)
@@ -132,6 +132,7 @@ typedef enum {
     VIR_STORAGE_NET_PROTOCOL_FTP,
     VIR_STORAGE_NET_PROTOCOL_FTPS,
     VIR_STORAGE_NET_PROTOCOL_TFTP,
+    VIR_STORAGE_NET_PROTOCOL_SSH,
 
     VIR_STORAGE_NET_PROTOCOL_LAST
 } virStorageNetProtocol;
index dcd484996f96a03ac6a23b0652b105fed457d714..25a3621084d4023ca69d0b1bf4c549e306356a08 100644 (file)
@@ -727,6 +727,7 @@ xenFormatXLDiskSrcNet(virStorageSourcePtr src)
     case VIR_STORAGE_NET_PROTOCOL_ISCSI:
     case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
     case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG:
+    case VIR_STORAGE_NET_PROTOCOL_SSH:
     case VIR_STORAGE_NET_PROTOCOL_LAST:
     case VIR_STORAGE_NET_PROTOCOL_NONE:
         virReportError(VIR_ERR_NO_SUPPORT,