From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJohc-0004XT-DU for qemu-devel@nongnu.org; Sun, 24 Mar 2013 13:27:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJoha-00012P-VW for qemu-devel@nongnu.org; Sun, 24 Mar 2013 13:27:28 -0400 Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]:46120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJoha-00012C-Nu for qemu-devel@nongnu.org; Sun, 24 Mar 2013 13:27:26 -0400 Received: by mail-la0-f42.google.com with SMTP id fe20so10078412lab.1 for ; Sun, 24 Mar 2013 10:27:25 -0700 (PDT) Sender: Rabin Vincent From: Rabin Vincent Date: Sun, 24 Mar 2013 18:27:16 +0100 Message-Id: <1364146041-27041-2-git-send-email-rabin@rab.in> In-Reply-To: <1364146041-27041-1-git-send-email-rabin@rab.in> References: <1364146041-27041-1-git-send-email-rabin@rab.in> Subject: [Qemu-devel] [PATCHv2 1/6] dump: create writable files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Rabin Vincent The files dump-guest-memory are created as read-only even for the owner. This non-standard behaviour makes it annoying to deal with the dump files (eg. rm -f is needed to delete them or saving a new dump by overwriting the previous one is not possible). Change the code to generate files with write permissions set. If someone requires read-only files to be created, they can achieve it by setting umask. Signed-off-by: Rabin Vincent --- dump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dump.c b/dump.c index a25f509..8dd86b4 100644 --- a/dump.c +++ b/dump.c @@ -841,7 +841,8 @@ void qmp_dump_guest_memory(bool paging, const char *file, bool has_begin, #endif if (strstart(file, "file:", &p)) { - fd = qemu_open(p, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRUSR); + fd = qemu_open(p, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, + S_IRUSR | S_IWUSR); if (fd < 0) { error_set(errp, QERR_OPEN_FILE_FAILED, p); return; -- 1.7.10.4