From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrR6e-0006PR-W8 for qemu-devel@nongnu.org; Thu, 20 Nov 2014 07:45:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrR6Y-0005bG-QJ for qemu-devel@nongnu.org; Thu, 20 Nov 2014 07:45:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrR6Y-0005b2-IW for qemu-devel@nongnu.org; Thu, 20 Nov 2014 07:44:58 -0500 From: Max Reitz Date: Thu, 20 Nov 2014 13:44:45 +0100 Message-Id: <1416487488-8423-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH 0/3] blockdev: Add read-only option to change-blockdev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Peter Lieven , Markus Armbruster , Luiz Capitulino , Stefan Hajnoczi , Max Reitz The 'change' QMP and HMP command allows replacing the medium in drives which support this, e.g. floppy disk drives. For some drives, the medium carries information about whether it can be written to or not (again, floppy drives). Therefore, it should be possible to change the read-only state of block devices when changing the loaded medium. This series adds an optional additional parameter to the 'change' QMP and HMP command which allows changing the read-only state in four ways: - 'retain': Just keep the status as it was before; this is the current behavior and thus this will be the default. - 'ro': Force read-only access - 'rw': Force writable access - 'auto': This opens the new file R/W first, if that fails, the file is opened read-only. Max Reitz (3): blockdev: Add read-only option to change-blockdev qmp: Expose read-only option for 'change' hmp: Expose read-only option for 'change' blockdev.c | 41 ++++++++++++++++++++++++++++++++++++++--- hmp-commands.hx | 24 +++++++++++++++++++++--- hmp.c | 17 ++++++++++++++++- include/sysemu/blockdev.h | 3 ++- qapi-schema.json | 27 ++++++++++++++++++++++++++- qmp-commands.hx | 24 +++++++++++++++++++++++- qmp.c | 14 ++++++++++++-- 7 files changed, 138 insertions(+), 12 deletions(-) -- 1.9.3