From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5d4k-0000CB-OG for qemu-devel@nongnu.org; Fri, 11 Jul 2014 11:49:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5d4d-0006oc-9d for qemu-devel@nongnu.org; Fri, 11 Jul 2014 11:49:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45666) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5d4d-0006no-1r for qemu-devel@nongnu.org; Fri, 11 Jul 2014 11:49:23 -0400 Message-ID: <53C00776.6090406@redhat.com> Date: Fri, 11 Jul 2014 17:49:10 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1405064666-5359-1-git-send-email-drjones@redhat.com> <53C002FB.3000805@redhat.com> In-Reply-To: <53C002FB.3000805@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] backends: Introduce chr-testdev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Andrew Jones , qemu-devel@nongnu.org Cc: kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org Il 11/07/2014 17:30, Eric Blake ha scritto: > On 07/11/2014 01:44 AM, Andrew Jones wrote: >> From: Paolo Bonzini >> >> From: Paolo Bonzini >> >> chr-testdev enables a virtio serial channel to be used for guest >> initiated qemu exits. hw/misc/debugexit already enables guest >> initiated qemu exits, but only for PC targets. chr-testdev supports >> any virtio-capable target. kvm-unit-tests/arm is already making use >> of this backend. >> >> Currently there is a single command implemented, "q". It takes a >> (prefix) argument for the exit code, thus an exit is implemented by >> writing, e.g. "1q", to the virtio-serial port. >> >> It can be used as: >> $QEMU ... \ >> -device virtio-serial-device \ >> -device virtserialport,chardev=ctd -chardev testdev,id=ctd >> >> or, use: >> $QEMU ... \ >> -device virtio-serial-device \ >> -device virtconsole,chardev=ctd -chardev testdev,id=ctd >> >> to bind it to virtio-serial port0. >> > >> + >> + switch (c) { >> + case 'q': >> + exit((arg << 1) | 1); >> + break; > > I'm trying to figure out the motive for only exiting with odd numbers. > That is, 'q' => 1, '1q' => 3, '2q' => 5, '3q' => 7. It means that at > most, I can do '127q' => 255 before I suffer from exit() limiting things > to 8 bits. This wasn't explained in the commit message. It's just for parity with isa-debugexit. Paolo