From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G6Zy2-0006Oa-H5 for qemu-devel@nongnu.org; Fri, 28 Jul 2006 17:33:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G6Zxz-0006N9-W6 for qemu-devel@nongnu.org; Fri, 28 Jul 2006 17:33:57 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G6Zxz-0006Mo-8G for qemu-devel@nongnu.org; Fri, 28 Jul 2006 17:33:55 -0400 Received: from [128.131.2.110] (helo=mr.tuwien.ac.at) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G6a03-0005xP-Eq for qemu-devel@nongnu.org; Fri, 28 Jul 2006 17:36:03 -0400 Received: from baraddur.middleearth (v208-226.vps.tuwien.ac.at [128.131.208.226]) by mr.tuwien.ac.at (8.13.7/8.13.7) with ESMTP id k6SLXpAR013500 for ; Fri, 28 Jul 2006 23:33:51 +0200 (MEST) Received: from gondor.middleearth ([192.168.1.15] ident=manuel) by baraddur.middleearth with esmtp (Exim 4.50) id 1G6Zxk-0006LR-S0 for qemu-devel@nongnu.org; Fri, 28 Jul 2006 23:33:40 +0200 From: maestro Content-Type: multipart/mixed; boundary="=-nHDRgWVy5k2plGQJuLC/" Date: Fri, 28 Jul 2006 23:33:50 +0200 Message-Id: <1154122430.4120.24.camel@localhost.localdomain> Mime-Version: 1.0 Subject: [Qemu-devel] [PATCH] specify device_name for commit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-nHDRgWVy5k2plGQJuLC/ Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello all! With this patch only the specified device gets commited. Since this is my first attempt to send a patch to the list, please let me know what you think of it. cheers m. --=-nHDRgWVy5k2plGQJuLC/ Content-Disposition: attachment; filename=commit_device.patch Content-Type: text/x-patch; name=commit_device.patch; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Index: monitor.c =================================================================== RCS file: /sources/qemu/qemu/monitor.c,v retrieving revision 1.54 diff -u -r1.54 monitor.c --- monitor.c 16 Jul 2006 18:57:03 -0000 1.54 +++ monitor.c 28 Jul 2006 21:32:45 -0000 @@ -24,6 +24,7 @@ #include "vl.h" #include "disas.h" #include +#include "block_int.h" //#define DEBUG //#define DEBUG_COMPLETION @@ -167,13 +168,15 @@ help_cmd(name); } -static void do_commit(void) +static void do_commit(const char *device) { - int i; - + int i, all_devices; + + all_devices = !strcmp(device, "all"); for (i = 0; i < MAX_DISKS; i++) { if (bs_table[i]) { - bdrv_commit(bs_table[i]); + if (all_devices || !strcmp(bs_table[i]->device_name, device)) + bdrv_commit(bs_table[i]); } } } @@ -1138,8 +1141,8 @@ static term_cmd_t term_cmds[] = { { "help|?", "s?", do_help, "[cmd]", "show the help" }, - { "commit", "", do_commit, - "", "commit changes to the disk images (if -snapshot is used)" }, + { "commit", "s", do_commit, + "device|all", "commit changes to the disk images (if -snapshot is used)" }, { "info", "s?", do_info, "subcommand", "show various information about the system state" }, { "q|quit", "", do_quit, --=-nHDRgWVy5k2plGQJuLC/--