From patchwork Thu Nov 15 13:22:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Ruderich X-Patchwork-Id: 998314 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ruderich.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42whrq0czNz9s5c for ; Fri, 16 Nov 2018 00:23:39 +1100 (AEDT) Received: from localhost ([::1]:38795 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNHcO-00039L-It for incoming@patchwork.ozlabs.org; Thu, 15 Nov 2018 08:23:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNHbb-0002vn-Pz for qemu-devel@nongnu.org; Thu, 15 Nov 2018 08:22:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNHbX-0006uF-Uh for qemu-devel@nongnu.org; Thu, 15 Nov 2018 08:22:47 -0500 Received: from zucker2.schokokeks.org ([178.63.68.90]:51727) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gNHbW-0006tV-GC for qemu-devel@nongnu.org; Thu, 15 Nov 2018 08:22:43 -0500 Received: from blood-stain-child.lan.ruderich.org (localhost [::1]) (AUTH: PLAIN simon@ruderich.org, TLS: TLSv1/SSLv3, 128bits, ECDHE-RSA-AES128-GCM-SHA256) by zucker.schokokeks.org with ESMTPSA; Thu, 15 Nov 2018 14:22:40 +0100 id 0000000000000049.000000005BED7320.00004450 From: Simon Ruderich To: qemu-devel@nongnu.org Date: Thu, 15 Nov 2018 14:22:33 +0100 Message-Id: X-Mailer: git-send-email 2.19.1 In-Reply-To: <0e59c79ddc01e195ddc59d77d9df2b95bf89b600.1523395243.git.simon@ruderich.org> References: <0e59c79ddc01e195ddc59d77d9df2b95bf89b600.1523395243.git.simon@ruderich.org> Mime-Version: 1.0 X-Mime-Autoconverted: from 8bit to 7bit by courier 0.75 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 178.63.68.90 Subject: [Qemu-devel] [PATCH v7 0/7] qmp: add pmemload command 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: Simon Ruderich , David Alan Gilbert , Markus Armbruster , Peter Crosthwaite , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Hello again, Please ignore v6, I forgot one patch. I hope I got it right this time. As I got no replies to my last mails, here again the full patch set (rebased on current master) in the hope to get this merged. The first few patches are cleanup, the last two patches add the pmemload feature. Only 5/6 requires an ack (although all mentioned issues should be fixed), all other patches were already reviewed in the last round. If there's anything else I can do to get this merged, please tell me. Regards Simon Ruderich Simon Ruderich (7): cpus: correct coding style in qmp_memsave/qmp_pmemsave cpus: convert qmp_memsave/qmp_pmemsave to use qemu_open cpus: use size_t in qmp_memsave/qmp_pmemsave hmp: use l for size argument in memsave/pmemsave hmp: use F for filename arguments in memsave/pmemsave qmp: add pmemload command hmp: add pmemload command cpus.c | 81 ++++++++++++++++++++++++++++++++++++++++--------- hmp-commands.hx | 18 +++++++++-- hmp.c | 16 ++++++++-- hmp.h | 1 + qapi/misc.json | 20 ++++++++++++ 5 files changed, 118 insertions(+), 18 deletions(-) No changes between v6 and v7, but v6 missed one patch. Diff between v5 and v7: --- a/qapi/misc.json +++ b/qapi/misc.json @@ -1201,7 +1201,7 @@ # # Returns: Nothing on success # -# Since: 3.1 +# Since: 3.2 ## { 'command': 'pmemload', 'data': {'val': 'int', 'filename': 'str', '*size': 'int', '*offset': 'int'} } Diff between v4 (last full series) and v7: --- a/cpus.c +++ b/cpus.c @@ -2473,6 +2473,10 @@ void qmp_pmemload(int64_t addr, const char *filename, error_setg_errno(errp, errno, "could not fstat fd to get size"); goto exit; } + if (S_ISCHR(s.st_mode) || S_ISBLK(s.st_mode)) { + error_setg(errp, "pmemload doesn't support char/block devices"); + goto exit; + } size = s.st_size; } --- a/qapi/misc.json +++ b/qapi/misc.json @@ -1201,7 +1201,7 @@ # # Returns: Nothing on success # -# Since: 3.1 +# Since: 3.2 ## { 'command': 'pmemload', 'data': {'val': 'int', 'filename': 'str', '*size': 'int', '*offset': 'int'} }