Re: [PATCH 2/2] kvm tool: Close kernel FD after loading it into memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 9 Apr 2011, Sasha Levin wrote:
Once the kernel has been loaded into the guest memory, close the FD of the file.

Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx>
---
tools/kvm/kvm.c |    6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c
index af1f65f..5027a0d 100644
--- a/tools/kvm/kvm.c
+++ b/tools/kvm/kvm.c
@@ -385,9 +385,15 @@ bool kvm__load_kernel(struct kvm *kvm, const char *kernel_filename,
	if (ret)
		goto found_kernel;

+	if (fd_kernel >= 0)
+		close(fd_kernel);
+
	die("%s is not a valid bzImage or flat binary", kernel_filename);

found_kernel:
+	if (fd_kernel >= 0)

These checks are not needed. I cleaned those up and applied the patch. Thanks!
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux