]> git.proxmox.com Git - qemu.git/blobdiff - hw/mc146818rtc.c
qapi: move include files to include/qobject/
[qemu.git] / hw / mc146818rtc.c
index 7d84ce3d74e38edbabedba51b2c63985c599af4d..2a1278f3931d029d299f06bf82fb26c538bd3b68 100644 (file)
@@ -25,7 +25,7 @@
 #include "qemu-timer.h"
 #include "sysemu.h"
 #include "mc146818rtc.h"
-#include "qapi/qapi-visit-core.h"
+#include "qapi/visitor.h"
 
 #ifdef TARGET_I386
 #include "apic.h"
@@ -570,7 +570,11 @@ static void rtc_update_time(RTCState *s)
     guest_nsec = get_guest_rtc_ns(s);
     guest_sec = guest_nsec / NSEC_PER_SEC;
     gmtime_r(&guest_sec, &ret);
-    rtc_set_cmos(s, &ret);
+
+    /* Is SET flag of Register B disabled? */
+    if ((s->cmos_data[RTC_REG_B] & REG_B_SET) == 0) {
+        rtc_set_cmos(s, &ret);
+    }
 }
 
 static int update_in_progress(RTCState *s)