Commit NAND image changes on "commit all" or "commit mtd".


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2858 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/monitor.c b/monitor.c
index 9f76c09..370bdfe 100644
--- a/monitor.c
+++ b/monitor.c
@@ -202,7 +202,7 @@
 static void do_commit(const char *device)
 {
     int i, all_devices;
-    
+
     all_devices = !strcmp(device, "all");
     for (i = 0; i < MAX_DISKS; i++) {
         if (bs_table[i]) {
@@ -211,6 +211,9 @@
                 bdrv_commit(bs_table[i]);
         }
     }
+    if (mtd_bdrv)
+        if (all_devices || !strcmp(bdrv_get_device_name(mtd_bdrv), device))
+            bdrv_commit(mtd_bdrv);
 }
 
 static void do_info(const char *item)