From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amit Shah Subject: Re: [PATCH] KVM test: virtio_console test v2 Date: Thu, 9 Sep 2010 17:43:38 +0530 Message-ID: <20100909121338.GL9793@amit-laptop.redhat.com> References: <1283396336-3970-1-git-send-email-lmr@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: autotest@test.kernel.org, kvm@vger.kernel.org, =?utf-8?B?THVrw6HFoQ==?= Doktor , Jiri Zupka To: Lucas Meneghel Rodrigues Return-path: Received: from mx1.redhat.com ([209.132.183.28]:8801 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750879Ab0IIMNp (ORCPT ); Thu, 9 Sep 2010 08:13:45 -0400 Content-Disposition: inline In-Reply-To: <1283396336-3970-1-git-send-email-lmr@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: I set up autotest and could run the test that's committed, seems to work well so far :-) Just one note for the console case. I haven't explored the tests in detail yet, but this is what suddenly stood out: On (Wed) Sep 01 2010 [23:58:56], Lucas Meneghel Rodrigues wrote: > +def get_port_status(): > + """ > + Get info about ports from kernel debugfs. > + > + @return: ports dictionary of port properties > + """ > + ports = {} > + > + not_present_msg = "FAIL: There's no virtio-ports dir in debugfs" > + if not os.path.ismount(DEBUGPATH): > + os.system('mount -t debugfs none %s' % DEBUGPATH) > + try: > + if not os.path.isdir('%s/virtio-ports' % DEBUGPATH): > + print not_present_msg > + except: > + print not_present_msg > + else: > + viop_names = os.listdir('%s/virtio-ports' % DEBUGPATH) > + for name in viop_names: > + f = open("%s/virtio-ports/%s" % (DEBUGPATH, name), 'r') > + port = {} > + for line in iter(f): > + m = re.match("(\S+): (\S+)",line) > + port[m.group(1)] = m.group(2) > + > + if (port['is_console'] == "yes"): > + port["path"] = "/dev/hvc%s" % port["console_vtermno"] > + # Console works like a serialport No, it doesn't :-) The 'console' ports hook up with hvc and you can then tie a tty with the hvc console. So you can do something like 'agetty /dev/hvc0 9600 vt100' and get a login shell on the host chardev. So the interesting tests for console ports are to spawn two of them, and in two threads which run at the same time, do 'find /' in one and 'while true; do dmesg; done' in the other so that both threads are doing something. The 'find /' test had found an smp bug earlier and doing this in two different threads will help in finding any other locking issues in virtio_console or hvc or tty code. Amit