Il 09/01/2014 22:14, thomas knych ha scritto: > Upstreaming this change from Android > (https://android-review.googlesource.com/54211). > > On heavily loaded machines with many VM instances we see KVM_CREATE_VM > failing with EINTR/EAGAIN retrying the system call greatly improves > reliability. > > Signed-off-by: thomas knych <thoma...@google.com> > --- > kvm-all.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/kvm-all.c b/kvm-all.c > index 3937754..29787ae 100644 > --- a/kvm-all.c > +++ b/kvm-all.c > @@ -1442,8 +1442,14 @@ int kvm_init(void) > nc++; > } > > - s->vmfd = kvm_ioctl(s, KVM_CREATE_VM, 0); > + do { > + s->vmfd = kvm_ioctl(s, KVM_CREATE_VM, 0); > + } while (s->vmfd < 0 && (-EINTR == s->vmfd || -EAGAIN == s->vmfd));
No yoda conditionals---please write "s->vmfd == -EINTR". However, I would like to understand where in the KVM module the error originates and is propagated from. Especially EAGAIN seems weird. Paolo > + > if (s->vmfd < 0) { > + fprintf(stderr, "ioctl(KVM_CREATE_VM) failed: %d %s\n", -s->vmfd, > + strerror(-s->vmfd)); > + > #ifdef TARGET_S390X > fprintf(stderr, "Please add the 'switch_amode' kernel parameter to " > "your host kernel command line\n"); >