[{"id":1760022,"web_url":"http://patchwork.ozlabs.org/comment/1760022/","msgid":"<20170830101536.GC18526@redhat.com>","list_archive_url":null,"date":"2017-08-30T10:15:36","subject":"Re: [Qemu-devel] [PATCH] fixup! hostmem-file: Add \"discard-data\"\n\toption","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Tue, Aug 29, 2017 at 06:36:57PM -0300, Eduardo Habkost wrote:\n> On Tue, Aug 29, 2017 at 10:12:58AM -0300, Eduardo Habkost wrote:\n> > On Tue, Aug 29, 2017 at 12:13:45PM +0100, Daniel P. Berrange wrote:\n> > > On Thu, Aug 24, 2017 at 04:23:15PM -0300, Eduardo Habkost wrote:\n> [...]\n> > > > @@ -4172,6 +4172,9 @@ the path to either a shared memory or huge page filesystem mount.\n> > > >  The @option{share} boolean option determines whether the memory\n> > > >  region is marked as private to QEMU, or shared. The latter allows\n> > > >  a co-operating external process to access the QEMU memory region.\n> > > > +Setting the @option{discard-data} boolean option to @var{on}\n> > > > +indicates that file contents can be destroyed when QEMU exits,\n> > > > +to avoid unnecessarily flushing data to the backing file.\n> > > \n> > > We should note that this only works if QEMU shuts down normally. If QEMU\n> > > is aggressively killed (SIGKILL) or aborts for some reason, then we'll\n> > > never get a chance to invoke madvise(), so presumably the kernel will\n> > > still flush the data\n> > \n> > Good point.  I tried to not give any guarantees by saying\n> > \"contents _can_ be destroyed\", but users may still have different\n> > expectations.\n> > \n> > I will change it to:\n> > \n> >   Setting the @option{discard-data} boolean option to @var{on}\n> >   indicates that file contents can be destroyed when QEMU exits,\n> >   to avoid unnecessarily flushing data to the backing file.  Note\n> >   that @option{discard-data} is only an optimization, and QEMU\n> >   might not discard file contents if it aborts unexpectedly or is\n> >   terminated using SIGKILL.\n> \n> Fixup patch:\n> \n> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>\n> ---\n>  qemu-options.hx | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n> \n> diff --git a/qemu-options.hx b/qemu-options.hx\n> index ad985e4..de9a18a 100644\n> --- a/qemu-options.hx\n> +++ b/qemu-options.hx\n> @@ -4174,7 +4174,10 @@ region is marked as private to QEMU, or shared. The latter allows\n>  a co-operating external process to access the QEMU memory region.\n>  Setting the @option{discard-data} boolean option to @var{on}\n>  indicates that file contents can be destroyed when QEMU exits,\n> -to avoid unnecessarily flushing data to the backing file.\n> +to avoid unnecessarily flushing data to the backing file.  Note\n> +that @option{discard-data} is only an optimization, and QEMU\n> +might not discard file contents if it aborts unexpectedly or is\n> +terminated using SIGKILL.\n>  \n>  @item -object rng-random,id=@var{id},filename=@var{/dev/random}\n\nFor the combined patch:\n\nReviewed-by: Daniel P. Berrange <berrange@redhat.com>\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xj1cj5PNfz9t1t\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 20:16:21 +1000 (AEST)","from localhost ([::1]:49469 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dn02l-0001go-Gf\n\tfor incoming@patchwork.ozlabs.org; Wed, 30 Aug 2017 06:16:19 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:32805)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dn02G-0001ea-LI\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 06:15:50 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dn02C-0000Lj-Ll\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 06:15:48 -0400","from mx1.redhat.com ([209.132.183.28]:56018)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dn02C-0000KT-BR\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 06:15:44 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 5D3DDC047B8F;\n\tWed, 30 Aug 2017 10:15:43 +0000 (UTC)","from redhat.com (unknown [10.33.36.122])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 0833B97BC1;\n\tWed, 30 Aug 2017 10:15:41 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 5D3DDC047B8F","Date":"Wed, 30 Aug 2017 11:15:36 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Eduardo Habkost <ehabkost@redhat.com>","Message-ID":"<20170830101536.GC18526@redhat.com>","References":"<20170824192315.5897-1-ehabkost@redhat.com>\n\t<20170824192315.5897-4-ehabkost@redhat.com>\n\t<20170829111345.GI3783@redhat.com>\n\t<20170829131258.GA30734@localhost.localdomain>\n\t<20170829213657.GO27715@localhost.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170829213657.GO27715@localhost.localdomain>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tWed, 30 Aug 2017 10:15:43 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH] fixup! hostmem-file: Add \"discard-data\"\n\toption","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"Paolo Bonzini <pbonzini@redhat.com>,\n\tZack Cornelius <zack.cornelius@kove.net>, qemu-devel@nongnu.org,\n\t\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>,\n\tIgor Mammedov <imammedo@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]