On Fri, Feb 1, 2019 at 4:17 PM Michael S. Tsirkin <m...@redhat.com> wrote: > > On Thu, Jan 31, 2019 at 04:19:11PM +0100, Stefano Garzarella wrote: > > In order to avoid migration issues, we enable DISCARD and > > WRITE ZEROES features only for machine type >= 4.0 > > > > Suggested-by: Dr. David Alan Gilbert <dgilb...@redhat.com> > > Signed-off-by: Stefano Garzarella <sgarz...@redhat.com> > > --- > > hw/block/virtio-blk.c | 2 ++ > > hw/core/machine.c | 1 + > > include/hw/virtio/virtio-blk.h | 1 + > > 3 files changed, 4 insertions(+) > > > > diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c > > index 8a6754d9a2..542ec52536 100644 > > --- a/hw/block/virtio-blk.c > > +++ b/hw/block/virtio-blk.c > > @@ -1026,6 +1026,8 @@ static Property virtio_blk_properties[] = { > > DEFINE_PROP_UINT16("queue-size", VirtIOBlock, conf.queue_size, 128), > > DEFINE_PROP_LINK("iothread", VirtIOBlock, conf.iothread, TYPE_IOTHREAD, > > IOThread *), > > + DEFINE_PROP_BIT("discard-wzeroes", VirtIOBlock, conf.discard_wzeroes, > > 0, > > + true), > > DEFINE_PROP_END_OF_LIST(), > > }; > > > > Thinking about it, are there security implications for discard? > Should we make it default false?
Hi Michael, I'm not completely sure but if the guest can write on a specific sector, discard or write_zeroes operations should not have a security implication. Do I miss something? Thanks, Stefano