Re: [PATCH 67/80] qemu: command: Remove unused qemuGetDriveSourceString

2022-08-05 Thread Pavel Hrdina
On Tue, Jul 26, 2022 at 04:37:45PM +0200, Peter Krempa wrote:
> Signed-off-by: Peter Krempa 
> ---
>  src/qemu/qemu_command.c | 208 
>  src/qemu/qemu_command.h |   4 -
>  2 files changed, 212 deletions(-)

Reviewed-by: Pavel Hrdina 


signature.asc
Description: PGP signature


[PATCH 67/80] qemu: command: Remove unused qemuGetDriveSourceString

2022-07-26 Thread Peter Krempa
Signed-off-by: Peter Krempa 
---
 src/qemu/qemu_command.c | 208 
 src/qemu/qemu_command.h |   4 -
 2 files changed, 212 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 9fc3d91a42..a8c954edf6 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1558,214 +1558,6 @@ qemuBuildChardevCommand(virCommand *cmd,
 }


-static char *
-qemuBuildNetworkDriveURI(virStorageSource *src)
-{
-g_autoptr(virURI) uri = NULL;
-
-if (!(uri = qemuBlockStorageSourceGetURI(src)))
-return NULL;
-
-if (src->hosts->socket)
-uri->query = g_strdup_printf("socket=%s", src->hosts->socket);
-
-return virURIFormat(uri);
-}
-
-
-static char *
-qemuBuildNetworkDriveStr(virStorageSource *src,
- qemuDomainSecretInfo *secinfo)
-{
-g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
-size_t i;
-char *ret = NULL;
-
-switch ((virStorageNetProtocol) src->protocol) {
-case VIR_STORAGE_NET_PROTOCOL_NBD:
-if (src->nhosts != 1) {
-virReportError(VIR_ERR_INTERNAL_ERROR,
-   _("protocol '%s' accepts only one host"),
-   
virStorageNetProtocolTypeToString(src->protocol));
-return NULL;
-}
-
-if (!((src->hosts->name && strchr(src->hosts->name, ':')) ||
-  (src->hosts->transport == VIR_STORAGE_NET_HOST_TRANS_TCP &&
-   !src->hosts->name) ||
-  (src->hosts->transport == VIR_STORAGE_NET_HOST_TRANS_UNIX &&
-   src->hosts->socket &&
-   !g_path_is_absolute(src->hosts->socket {
-
-virBufferAddLit(, "nbd:");
-
-switch (src->hosts->transport) {
-case VIR_STORAGE_NET_HOST_TRANS_TCP:
-virBufferAsprintf(, "%s:%u",
-  src->hosts->name, src->hosts->port);
-break;
-
-case VIR_STORAGE_NET_HOST_TRANS_UNIX:
-if (!src->hosts->socket) {
-virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-   _("socket attribute required for "
- "unix transport"));
-return NULL;
-}
-
-virBufferAsprintf(, "unix:%s", src->hosts->socket);
-break;
-
-default:
-virReportError(VIR_ERR_INTERNAL_ERROR,
-   _("nbd does not support transport '%s'"),
-   
virStorageNetHostTransportTypeToString(src->hosts->transport));
-return NULL;
-}
-
-if (src->path)
-virBufferAsprintf(, ":exportname=%s", src->path);
-
-return virBufferContentAndReset();
-}
-/* NBD code uses URI formatting scheme as others in some cases */
-ret = qemuBuildNetworkDriveURI(src);
-break;
-
-case VIR_STORAGE_NET_PROTOCOL_HTTP:
-case VIR_STORAGE_NET_PROTOCOL_HTTPS:
-case VIR_STORAGE_NET_PROTOCOL_FTP:
-case VIR_STORAGE_NET_PROTOCOL_FTPS:
-case VIR_STORAGE_NET_PROTOCOL_TFTP:
-case VIR_STORAGE_NET_PROTOCOL_ISCSI:
-case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
-ret = qemuBuildNetworkDriveURI(src);
-break;
-
-case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG:
-if (!src->path) {
-virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-   _("missing disk source for 'sheepdog' 
protocol"));
-return NULL;
-}
-
-if (src->nhosts == 0) {
-ret = g_strdup_printf("sheepdog:%s", src->path);
-} else if (src->nhosts == 1) {
-ret = g_strdup_printf("sheepdog:%s:%u:%s", src->hosts->name,
-  src->hosts->port, src->path);
-} else {
-virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-   _("protocol 'sheepdog' accepts up to one 
host"));
-return NULL;
-}
-
-break;
-
-case VIR_STORAGE_NET_PROTOCOL_RBD:
-if (strchr(src->path, ':')) {
-virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-   _("':' not allowed in RBD source volume name 
'%s'"),
-   src->path);
-return NULL;
-}
-
-virBufferStrcat(, "rbd:", src->volume, "/", src->path, NULL);
-
-if (src->snapshot)
-virBufferEscape(, '\\', ":", "@%s", src->snapshot);
-
-if (!secinfo)
-virBufferAddLit(, ":auth_supported=none");
-else
-virBufferEscape(, '\\', ":",