kvm: x86: Check kvm_write_guest return value in kvm_write_wall_clock

This makes sure the wall clock is updated only after an odd version value
is successfully written to guest memory.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Nicholas Krause 2015-12-30 13:08:46 -05:00 коммит произвёл Paolo Bonzini
Родитель 0af2593b2a
Коммит 1dab1345d8
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -1169,7 +1169,8 @@ static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock)
++version;
kvm_write_guest(kvm, wall_clock, &version, sizeof(version));
if (kvm_write_guest(kvm, wall_clock, &version, sizeof(version)))
return;
/*
* The guest calculates current wall clock time by adding