* [PATCH 0/1] virtio: disable partitions scanning for no partitions block
@ 2021-05-20 13:36 Yury Kamenev
2021-05-20 13:36 ` [PATCH 1/1] " Yury Kamenev
0 siblings, 1 reply; 2+ messages in thread
From: Yury Kamenev @ 2021-05-20 13:36 UTC (permalink / raw)
To: mst, stefanha, kwolf, mreitz, qemu-block, qemu-devel; +Cc: Yury Kamenev
Some virtio blocks definitely have no partitions and should not be scanned.
Yury Kamenev (1):
virtio: disable partitions scanning for no partitions block
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(+)
--
2.24.3 (Apple Git-128)
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] virtio: disable partitions scanning for no partitions block
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
0 siblings, 0 replies; 2+ messages in thread
From: Yury Kamenev @ 2021-05-20 13:36 UTC (permalink / raw)
To: mst, stefanha, kwolf, mreitz, qemu-block, qemu-devel; +Cc: Yury Kamenev
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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-20 15:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 13:36 [PATCH 0/1] virtio: disable partitions scanning for no partitions block Yury Kamenev
2021-05-20 13:36 ` [PATCH 1/1] " Yury Kamenev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).