All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yury Kamenev <damtev@yandex-team.ru>
To: mst@redhat.com, stefanha@redhat.com, kwolf@redhat.com,
	mreitz@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: Yury Kamenev <damtev@yandex-team.ru>
Subject: [PATCH 1/1] virtio: disable partitions scanning for no partitions block
Date: Thu, 20 May 2021 16:36:08 +0300	[thread overview]
Message-ID: <20210520133608.98785-2-damtev@yandex-team.ru> (raw)
In-Reply-To: <20210520133608.98785-1-damtev@yandex-team.ru>

Signed-off-by: Yury Kamenev <damtev@yandex-team.ru>
---
 hw/block/virtio-blk.c                       | 4 ++++
 include/hw/virtio/virtio-blk.h              | 1 +
 include/standard-headers/linux/virtio_blk.h | 1 +
 3 files changed, 6 insertions(+)

diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index f139cd7cc9..abf375b490 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -1031,6 +1031,9 @@ static uint64_t virtio_blk_get_features(VirtIODevice *vdev, uint64_t features,
     if (s->conf.num_queues > 1) {
         virtio_add_feature(&features, VIRTIO_BLK_F_MQ);
     }
+    if (!s->conf.scan_parts) {
+        virtio_add_feature(&features, VIRTIO_BLK_F_NO_PS);
+    }
 
     return features;
 }
@@ -1295,6 +1298,7 @@ static Property virtio_blk_properties[] = {
 #endif
     DEFINE_PROP_BIT("request-merging", VirtIOBlock, conf.request_merging, 0,
                     true),
+    DEFINE_PROP_BOOL("scan-parts", VirtIOBlock, conf.scan_parts, true),
     DEFINE_PROP_UINT16("num-queues", VirtIOBlock, conf.num_queues,
                        VIRTIO_BLK_AUTO_NUM_QUEUES),
     DEFINE_PROP_UINT16("queue-size", VirtIOBlock, conf.queue_size, 256),
diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
index 29655a406d..706a789ad5 100644
--- a/include/hw/virtio/virtio-blk.h
+++ b/include/hw/virtio/virtio-blk.h
@@ -41,6 +41,7 @@ struct VirtIOBlkConf
     uint16_t num_queues;
     uint16_t queue_size;
     bool seg_max_adjust;
+    bool scan_parts;
     bool report_discard_granularity;
     uint32_t max_discard_sectors;
     uint32_t max_write_zeroes_sectors;
diff --git a/include/standard-headers/linux/virtio_blk.h b/include/standard-headers/linux/virtio_blk.h
index 2dcc90826a..6b7b2db29c 100644
--- a/include/standard-headers/linux/virtio_blk.h
+++ b/include/standard-headers/linux/virtio_blk.h
@@ -40,6 +40,7 @@
 #define VIRTIO_BLK_F_MQ		12	/* support more than one vq */
 #define VIRTIO_BLK_F_DISCARD	13	/* DISCARD is supported */
 #define VIRTIO_BLK_F_WRITE_ZEROES	14	/* WRITE ZEROES is supported */
+#define VIRTIO_BLK_F_NO_PS      16      /* Disable partitions scanning */
 
 /* Legacy feature bits */
 #ifndef VIRTIO_BLK_NO_LEGACY
-- 
2.24.3 (Apple Git-128)



  reply	other threads:[~2021-05-20 15:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-20 13:36 [PATCH 0/1] virtio: disable partitions scanning for no partitions block Yury Kamenev
2021-05-20 13:36 ` Yury Kamenev [this message]
2021-05-20 13:39 Yury Kamenev
2021-05-20 13:39 ` [PATCH 1/1] " Yury Kamenev
2021-05-24 14:29   ` Stefan Hajnoczi
2021-05-24 14:29     ` Stefan Hajnoczi
2021-05-24 14:56     ` Christoph Hellwig
2021-05-24 14:56       ` Christoph Hellwig
2021-05-24 16:25       ` Ulf Hansson
2021-05-24 16:25         ` Ulf Hansson
     [not found]     ` <90021621883891@mail.yandex-team.ru>
2021-05-24 19:41       ` Paolo Bonzini
2021-05-24 19:41         ` Paolo Bonzini
2021-05-25 12:00         ` Iurii Kamenev
2021-07-15  9:47 [PATCH 0/1] " Yury Kamenev
2021-07-15  9:47 ` [PATCH 1/1] " Yury Kamenev
2021-07-15 11:22   ` Paolo Bonzini
2021-07-15 11:22     ` Paolo Bonzini
2021-07-16  1:09   ` kernel test robot
2021-07-16  1:09     ` kernel test robot
2021-07-16  1:09     ` kernel test robot
2021-07-16  2:57   ` Jason Wang
2021-07-16  2:57     ` Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210520133608.98785-2-damtev@yandex-team.ru \
    --to=damtev@yandex-team.ru \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.