From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [RFC/PATCH] virtio-console: wait for console ports Date: Thu, 22 Sep 2011 13:20:07 +0200 Message-ID: <4E7B19E7.2090602@de.ibm.com> References: <4E7A0837.5080908@de.ibm.com> <20110922100831.GB3105@amit-x200.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: KVM list , Rusty Russell , Carsten Otte , virtualization@lists.linux-foundation.org To: Amit Shah Return-path: Received: from mtagate3.uk.ibm.com ([194.196.100.163]:39431 "EHLO mtagate3.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753139Ab1IVLUN (ORCPT ); Thu, 22 Sep 2011 07:20:13 -0400 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p8MBKCmN026204 for ; Thu, 22 Sep 2011 11:20:12 GMT Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8MBKBDq2101272 for ; Thu, 22 Sep 2011 12:20:11 +0100 Received: from d06av07.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8MBKAwS006307 for ; Thu, 22 Sep 2011 05:20:11 -0600 In-Reply-To: <20110922100831.GB3105@amit-x200.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 22/09/11 12:08, Amit Shah wrote: >> + /* If there was an early virtio console, assume that there are no >> + * other consoles. We need to wait until the hvc_alloc matches the >> + * hvc_instantiate, otherwise tty_open will complain, resulting in >> + * a "Warning: unable to open an initial console" boot failure. >> + * Without multiport this is done in add_port above. With multiport >> + * this might take some host<->guest communication - thus we have to >> + * wait. */ > > This file uses comments in the form > /* > * ... > */ Will fix. > >> + if (multiport && early) >> + wait_for_completion(&port_added); >> + > > Can there be a problem to not timeout this wait? Maybe it's not a > real problem; just thinking out aloud. I had the same thoughts. I then asked myself, how big the timeout has to be - and the answer was it really depends on the host load. So we can certainly use wait_for_completion_timeout(&port_added, HZ*); which will work in 99.9% of all cases. It might still cause spurious boot failures, if for some reasons it takes too long. So the big question is, is there a case were virtio is used as an early console but virtio_console does not register a console during probe. Ideas? Christian