qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: maestro <maestro82@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] specify device_name for commit
Date: Fri, 28 Jul 2006 23:33:50 +0200	[thread overview]
Message-ID: <1154122430.4120.24.camel@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 183 bytes --]

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.



[-- Attachment #2: commit_device.patch --]
[-- Type: text/x-patch, Size: 1343 bytes --]

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 <dirent.h>
+#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,

                 reply	other threads:[~2006-07-28 21:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1154122430.4120.24.camel@localhost.localdomain \
    --to=maestro82@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).