From nobody Sun Feb 8 09:26:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504042698181459.914950162845; Tue, 29 Aug 2017 14:38:18 -0700 (PDT) Received: from localhost ([::1]:47118 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmoDA-0005xO-4W for importer@patchew.org; Tue, 29 Aug 2017 17:38:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmoC1-0005K3-GH for qemu-devel@nongnu.org; Tue, 29 Aug 2017 17:37:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmoBy-0003ep-AP for qemu-devel@nongnu.org; Tue, 29 Aug 2017 17:37:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41674) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dmoBy-0003eD-1K for qemu-devel@nongnu.org; Tue, 29 Aug 2017 17:37:02 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B7C25267CA; Tue, 29 Aug 2017 21:37:00 +0000 (UTC) Received: from localhost (ovpn-116-31.gru2.redhat.com [10.97.116.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3648D6A32C; Tue, 29 Aug 2017 21:36:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B7C25267CA Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com Date: Tue, 29 Aug 2017 18:36:57 -0300 From: Eduardo Habkost To: "Daniel P. Berrange" Message-ID: <20170829213657.GO27715@localhost.localdomain> References: <20170824192315.5897-1-ehabkost@redhat.com> <20170824192315.5897-4-ehabkost@redhat.com> <20170829111345.GI3783@redhat.com> <20170829131258.GA30734@localhost.localdomain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170829131258.GA30734@localhost.localdomain> X-Fnord: you can see the fnord User-Agent: Mutt/1.8.0 (2017-02-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 (mx1.redhat.com [10.5.110.30]); Tue, 29 Aug 2017 21:37:01 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] fixup! hostmem-file: Add "discard-data" option X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Zack Cornelius , qemu-devel@nongnu.org, "Dr. David Alan Gilbert" , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On Tue, Aug 29, 2017 at 10:12:58AM -0300, Eduardo Habkost wrote: > On Tue, Aug 29, 2017 at 12:13:45PM +0100, Daniel P. Berrange wrote: > > On Thu, Aug 24, 2017 at 04:23:15PM -0300, Eduardo Habkost wrote: [...] > > > @@ -4172,6 +4172,9 @@ the path to either a shared memory or huge page= filesystem mount. > > > The @option{share} boolean option determines whether the memory > > > region is marked as private to QEMU, or shared. The latter allows > > > a co-operating external process to access the QEMU memory region. > > > +Setting the @option{discard-data} boolean option to @var{on} > > > +indicates that file contents can be destroyed when QEMU exits, > > > +to avoid unnecessarily flushing data to the backing file. > >=20 > > We should note that this only works if QEMU shuts down normally. If QEMU > > is aggressively killed (SIGKILL) or aborts for some reason, then we'll > > never get a chance to invoke madvise(), so presumably the kernel will > > still flush the data >=20 > Good point. I tried to not give any guarantees by saying > "contents _can_ be destroyed", but users may still have different > expectations. >=20 > I will change it to: >=20 > Setting the @option{discard-data} boolean option to @var{on} > indicates that file contents can be destroyed when QEMU exits, > to avoid unnecessarily flushing data to the backing file. Note > that @option{discard-data} is only an optimization, and QEMU > might not discard file contents if it aborts unexpectedly or is > terminated using SIGKILL. Fixup patch: Signed-off-by: Eduardo Habkost Reviewed-by: Daniel P. Berrange --- qemu-options.hx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index ad985e4..de9a18a 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4174,7 +4174,10 @@ region is marked as private to QEMU, or shared. The = latter allows a co-operating external process to access the QEMU memory region. Setting the @option{discard-data} boolean option to @var{on} indicates that file contents can be destroyed when QEMU exits, -to avoid unnecessarily flushing data to the backing file. +to avoid unnecessarily flushing data to the backing file. Note +that @option{discard-data} is only an optimization, and QEMU +might not discard file contents if it aborts unexpectedly or is +terminated using SIGKILL. =20 @item -object rng-random,id=3D@var{id},filename=3D@var{/dev/random} =20 --=20 2.9.4