From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jobin Raju George Subject: Re: Using block device instead of character device for virtio-serial Date: Sat, 15 Feb 2014 10:30:13 +0530 Message-ID: References: <20140209091224.GB24892@stefanha-thinkpad.redhat.com> <20140214103516.GF12053@stefanha-thinkpad.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: kvm@vger.kernel.org To: Stefan Hajnoczi Return-path: Received: from mail-oa0-f52.google.com ([209.85.219.52]:36703 "EHLO mail-oa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750702AbaBOFAO (ORCPT ); Sat, 15 Feb 2014 00:00:14 -0500 Received: by mail-oa0-f52.google.com with SMTP id i4so15497452oah.39 for ; Fri, 14 Feb 2014 21:00:13 -0800 (PST) In-Reply-To: <20140214103516.GF12053@stefanha-thinkpad.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Feb 14, 2014 at 4:05 PM, Stefan Hajnoczi wrote: > > On Sun, Feb 09, 2014 at 11:39:19PM +0530, Jobin Raju George wrote: > > On Sun, Feb 9, 2014 at 2:42 PM, Stefan Hajnoczi wrote: > > > > > On Thu, Feb 06, 2014 at 12:22:36PM +0530, Jobin Raju George wrote: > > > > I am trying to establish a communication mechanism between the guest > > > > and its host using virtio-serial. For this I am using the following to > > > > boot the VM: > > > > > > > > qemu-system-x86_64 -m 1024 \ > > > > -name ubuntu_vm \ > > > > -hda ubuntu \ > > > > -device virtio-serial \ > > > > -chardev socket,path=/tmp/virt_socket,server,nowait,id=virt_socket \ > > > > -device virtconsole,name=v_soc,chardev=virt_socket,name=ubuntu_vm_soc > > > > > > > > This creates a character device on the guest machine and a UNIX socket > > > > on the host machine. > > > > > > > > 1) Is there a way I can create sockets on the host as well as the guest? > > > > > > The syntax is documented on the QEMU man page. Try: > > > > > > -chardev socket,port=1234,server,nowait,id=virt_socket > > > > > > > I did not try this out, but would this create a "socket" instead of a > > character device(/dev/hvc0) on the guest? > > Things should be unchanged inside the guest. This just creates a TCP > socket on the host. My main concern is creating a socket in the guest. > > > > > > > > 2) Is there a way I can create a block device for communication? > > > > > > > > I required a block device since the data that is to be transferred is > > > > huge and the frequency of the data transfer is quite high. > > > > > > Have you benchmarked virtio-serial or is this just a guess? > > > > > > > I have not benchmarked virtio-serial but it seems to be intuitive that a > > block device would perform data transfer at a faster rate than a character > > device. I may be wrong, would be happy to be corrected. And yes, I would > > like to know how can I benchmark virtio-serial using a character device vs > > a TCP/IP socket data transfer vs virtio-serial using a block device. > > Write a program that transfers data and measures the speed :-). It seems like netperf: www.netperf.org/netperf/training/Netperf.html is pretty useful for this purpose. -- Thanks and regards, Jobin Raju George Final Year, Information Technology College of Engineering Pune Alternate e-mail: georgejr10.it@coep.ac.in