Received: from eggs.gnu.org ([2001:4830:134:3::10]:52541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3emu-00041K-Mz for qemu-devel@nongnu.org; Mon, 07 Nov 2016 02:56:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3emq-0002rP-8u for qemu-devel@nongnu.org; Mon, 07 Nov 2016 02:56:16 -0500 Received: from mga07.intel.com ([134.134.136.100]:22203) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c3emp-0002pc-UV for qemu-devel@nongnu.org; Mon, 07 Nov 2016 02:56:12 -0500 Date: Mon, 7 Nov 2016 15:56:08 +0800 From: Haozhong Zhang Message-ID: <20161107075608.izcyrx6y6weyv3eu@hz-desktop> References: <20161107050859.31058-1-haozhong.zhang@intel.com> <87a8db20c0.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <87a8db20c0.fsf@dusky.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH 0/3] hostmem-file: make option 'size' optional List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Eduardo Habkost , Peter Crosthwaite , Paolo Bonzini , Igor Mammedov , Richard Henderson On 11/07/16 08:52 +0100, Markus Armbruster wrote: >Haozhong Zhang writes: > >> This patch series is mostly the followup of patch 3 in >> "[PATCH v2 0/3] Improve truncation behavior of memory-backend-file" [1][2]. >> >> For certain usages of memory-backend-file, users simply want to use >> the entire backend file (specified by the "mem-path" option). Therefore, >> it's not necessary in such cases to specify the file size via the >> "size" option. This patch series makes the "size" option of >> memory-backend-file optional. In detail, >> >> 1. if the size of the backend file is not zero and the "size" option >> is not present, QEMU will use the file size as the "size" option; >> >> 2. if the backend file is a non-existing file, an empty file, or a >> directory, the "size" option is still needed; >> >> 3. the "size" option is also needed in cases that QEMU fails to the >> backend file size. > >"fails to the backend file size": are you missing a verb? > Yes, it should be "fails to _get_ the backend file size". Thanks, Haozhong >> Patch 1 is not quite relevant. It adds missing comments on errors >> of get_file_size() per Eduardo's suggestion. >> >> Patch 2 moves the file operations from file_ram_alloc() to >> qemu_ram_alloc_from_file(), so that all checks on the file size and >> the "size" option, and the related operations on ram block length can >> be put in qemu_ram_alloc_from_file() and no duplication is needed. >> >> Patch 3 actually implements the logic to make the option "size" optional. >> >> [1] https://lists.nongnu.org/archive/html/qemu-devel/2016-10/msg06823.html >> [2] https://lists.nongnu.org/archive/html/qemu-devel/2016-11/msg00251.html >> >> Haozhong Zhang (3): >> exec.c: add comment for errors of get_file_size() >> exec.c: move file operations to qemu_ram_alloc_from_file() >> hostmem-file: make option 'size' optional >> >> backends/hostmem-file.c | 28 ++++-- >> exec.c | 242 ++++++++++++++++++++++++++++++------------------ >> 2 files changed, 170 insertions(+), 100 deletions(-)