902636
From 58b7d33e1bc17b89103ceaa39f5722a69b35d810 Mon Sep 17 00:00:00 2001
902636
From: Maxim Levitsky <mlevitsk@redhat.com>
902636
Date: Wed, 11 Mar 2020 10:51:45 +0000
902636
Subject: [PATCH 04/20] iscsi: Drop iscsi_co_create_opts()
902636
902636
RH-Author: Maxim Levitsky <mlevitsk@redhat.com>
902636
Message-id: <20200311105147.13208-5-mlevitsk@redhat.com>
902636
Patchwork-id: 94226
902636
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH v2 4/6] iscsi: Drop iscsi_co_create_opts()
902636
Bugzilla: 1640894
902636
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
902636
RH-Acked-by: John Snow <jsnow@redhat.com>
902636
RH-Acked-by: Max Reitz <mreitz@redhat.com>
902636
902636
From: Max Reitz <mreitz@redhat.com>
902636
902636
The generic fallback implementation effectively does the same.
902636
902636
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
902636
Signed-off-by: Max Reitz <mreitz@redhat.com>
902636
Message-Id: <20200122164532.178040-5-mreitz@redhat.com>
902636
Signed-off-by: Max Reitz <mreitz@redhat.com>
902636
(cherry picked from commit 80f0900905b555f00d644894c786b6d66ac2e00e)
902636
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
902636
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
902636
---
902636
 block/iscsi.c | 56 --------------------------------------------------------
902636
 1 file changed, 56 deletions(-)
902636
902636
diff --git a/block/iscsi.c b/block/iscsi.c
902636
index cbd5729..b45da65 100644
902636
--- a/block/iscsi.c
902636
+++ b/block/iscsi.c
902636
@@ -2164,58 +2164,6 @@ static int coroutine_fn iscsi_co_truncate(BlockDriverState *bs, int64_t offset,
902636
     return 0;
902636
 }
902636
 
902636
-static int coroutine_fn iscsi_co_create_opts(const char *filename, QemuOpts *opts,
902636
-                                             Error **errp)
902636
-{
902636
-    int ret = 0;
902636
-    int64_t total_size = 0;
902636
-    BlockDriverState *bs;
902636
-    IscsiLun *iscsilun = NULL;
902636
-    QDict *bs_options;
902636
-    Error *local_err = NULL;
902636
-
902636
-    bs = bdrv_new();
902636
-
902636
-    /* Read out options */
902636
-    total_size = DIV_ROUND_UP(qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0),
902636
-                              BDRV_SECTOR_SIZE);
902636
-    bs->opaque = g_new0(struct IscsiLun, 1);
902636
-    iscsilun = bs->opaque;
902636
-
902636
-    bs_options = qdict_new();
902636
-    iscsi_parse_filename(filename, bs_options, &local_err);
902636
-    if (local_err) {
902636
-        error_propagate(errp, local_err);
902636
-        ret = -EINVAL;
902636
-    } else {
902636
-        ret = iscsi_open(bs, bs_options, 0, NULL);
902636
-    }
902636
-    qobject_unref(bs_options);
902636
-
902636
-    if (ret != 0) {
902636
-        goto out;
902636
-    }
902636
-    iscsi_detach_aio_context(bs);
902636
-    if (iscsilun->type != TYPE_DISK) {
902636
-        ret = -ENODEV;
902636
-        goto out;
902636
-    }
902636
-    if (bs->total_sectors < total_size) {
902636
-        ret = -ENOSPC;
902636
-        goto out;
902636
-    }
902636
-
902636
-    ret = 0;
902636
-out:
902636
-    if (iscsilun->iscsi != NULL) {
902636
-        iscsi_destroy_context(iscsilun->iscsi);
902636
-    }
902636
-    g_free(bs->opaque);
902636
-    bs->opaque = NULL;
902636
-    bdrv_unref(bs);
902636
-    return ret;
902636
-}
902636
-
902636
 static int iscsi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
902636
 {
902636
     IscsiLun *iscsilun = bs->opaque;
902636
@@ -2486,8 +2434,6 @@ static BlockDriver bdrv_iscsi = {
902636
     .bdrv_parse_filename    = iscsi_parse_filename,
902636
     .bdrv_file_open         = iscsi_open,
902636
     .bdrv_close             = iscsi_close,
902636
-    .bdrv_co_create_opts    = iscsi_co_create_opts,
902636
-    .create_opts            = &iscsi_create_opts,
902636
     .bdrv_reopen_prepare    = iscsi_reopen_prepare,
902636
     .bdrv_reopen_commit     = iscsi_reopen_commit,
902636
     .bdrv_co_invalidate_cache = iscsi_co_invalidate_cache,
902636
@@ -2525,8 +2471,6 @@ static BlockDriver bdrv_iser = {
902636
     .bdrv_parse_filename    = iscsi_parse_filename,
902636
     .bdrv_file_open         = iscsi_open,
902636
     .bdrv_close             = iscsi_close,
902636
-    .bdrv_co_create_opts    = iscsi_co_create_opts,
902636
-    .create_opts            = &iscsi_create_opts,
902636
     .bdrv_reopen_prepare    = iscsi_reopen_prepare,
902636
     .bdrv_reopen_commit     = iscsi_reopen_commit,
902636
     .bdrv_co_invalidate_cache  = iscsi_co_invalidate_cache,
902636
-- 
902636
1.8.3.1
902636