[PATCHv2 09/10] util: storage: Add 'ssh' network storage protocol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Allow using 'ssh' protocol in backing chains and later for disks
themselves.
---
 src/libxl/libxl_conf.c        | 1 +
 src/qemu/qemu_command.c       | 7 +++++++
 src/qemu/qemu_driver.c        | 3 +++
 src/qemu/qemu_parse_command.c | 1 +
 src/util/virstoragefile.c     | 4 +++-
 src/util/virstoragefile.h     | 1 +
 src/xenconfig/xen_xl.c        | 1 +
 7 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 146e08a..2d6d5da 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -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,
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 3dc131b..5ac0725 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -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:
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 0501003..dd5a9ff 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13372,6 +13372,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 "
@@ -13434,6 +13435,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 "
@@ -13578,6 +13580,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 "
diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c
index 3f7e445..82d1621 100644
--- a/src/qemu/qemu_parse_command.c
+++ b/src/qemu/qemu_parse_command.c
@@ -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 */
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 169d70e..3e22b0c 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -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);
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index 1a76fad..3ea3a60 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -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;
diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c
index dcd4849..25a3621 100644
--- a/src/xenconfig/xen_xl.c
+++ b/src/xenconfig/xen_xl.c
@@ -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,
-- 
2.9.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]