[PATCH kvmtool 3/9] guest: sync disk before shutting down

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

 



sync() should be called before reboot(RB_AUTOBOOT), otherwise data written
to disks might be lost.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@xxxxxxx>
---
 guest/init.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/guest/init.c b/guest/init.c
index 1f9cd048a..52f6567da 100644
--- a/guest/init.c
+++ b/guest/init.c
@@ -72,6 +72,7 @@ int main(int argc, char *argv[])
 		} while (corpse != child);
 	}
 
+	sync();
 	reboot(RB_AUTOBOOT);
 
 	printf("Init failed: %s\n", strerror(errno));
-- 
2.20.1




[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