public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/3] kvm tools: Close the disk images after the guest shuts down
@ 2011-05-18 10:17 Prasad Joshi
  2011-05-18 10:17 ` [PATCH v1 2/3] kvm tools: Release memoty allocated during virtio block initialization Prasad Joshi
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Prasad Joshi @ 2011-05-18 10:17 UTC (permalink / raw)
  To: prasadjoshi124
  Cc: mingo, kvm, penberg, asias.hejun, gorcunov, levinsasha928,
	chaitanyakulkarni15, ashwini.kulkarni

Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com>
---
 tools/kvm/kvm-run.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/kvm-run.c b/tools/kvm/kvm-run.c
index ba8e5ce..ef180e4 100644
--- a/tools/kvm/kvm-run.c
+++ b/tools/kvm/kvm-run.c
@@ -46,6 +46,7 @@
 #define MAX_DISK_IMAGES		4
 
 static struct kvm *kvm;
+static struct disk_image *image_disks[MAX_DISK_IMAGES];
 static struct kvm_cpu *kvm_cpus[KVM_NR_CPUS];
 static __thread struct kvm_cpu *current_kvm_cpu;
 
@@ -504,6 +505,7 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
 				die("unable to load disk image %s", image_filename[i]);
 
 			virtio_blk__init(kvm, disk);
+			image_disks[i] = disk;
 		}
 	}
 	free(hi);
@@ -583,6 +585,11 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
 			exit_code	= 1;
 	}
 
+	for (i = 0; i < MAX_DISK_IMAGES; i++) {
+		if (image_disks[i])
+			disk_image__close(image_disks[i]);
+	}
+
 	kvm__delete(kvm);
 
 	if (!exit_code)
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-05-18 11:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-18 10:17 [PATCH v1 1/3] kvm tools: Close the disk images after the guest shuts down Prasad Joshi
2011-05-18 10:17 ` [PATCH v1 2/3] kvm tools: Release memoty allocated during virtio block initialization Prasad Joshi
2011-05-18 10:25   ` Pekka Enberg
2011-05-18 11:11   ` Ingo Molnar
2011-05-18 10:17 ` [PATCH v1 3/3] kvm tools: Add QCOW level2 caching support Prasad Joshi
2011-05-18 10:27   ` Pekka Enberg
2011-05-18 10:41     ` Prasad Joshi
2011-05-18 11:18       ` Pekka Enberg
2011-05-18 11:10     ` Ingo Molnar
2011-05-18 11:27   ` Sasha Levin
2011-05-18 10:31 ` [PATCH v1 1/3] kvm tools: Close the disk images after the guest shuts down Sasha Levin
2011-05-18 10:36   ` Prasad Joshi
2011-05-18 11:15 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox