[libvirt-users] pty pairing host - guest

Neel Basu neel.basu.z at gmail.com
Fri Mar 27 07:10:09 UTC 2015


Getting no output on /dev/hvcNN

On Thu, Mar 19, 2015 at 3:15 PM, Daniel P. Berrange <berrange at redhat.com>
wrote:

> On Thu, Mar 19, 2015 at 01:29:37PM +0530, Neel Basu wrote:
> > HI!,
> >
> > I am using virt-manager GUI. There I can add a `Console Device`  through
> > Add Hardware. I can add a virtio pty WITHOUT restarting the VM. also I
> get
> > a pty allocated to host machine say `/dev/pty/M`
> >
> > My expectation is this `host:/dev/pty/M` is connected with a
> > `guest:/dev/ttyN`. so If I open minicom or screen and write to
> > `host:/dev/pty/M` it will be propagated to 'guest:/dev/ttyN'. Is my
> > expectation correct ?
> >
> > If it is correct how will I know what is the guest tty allocated against
> > this host pty ?
>
> No, that's not how it works.  The <console> devices are exposed to
> the guest as /dev/hvcNN devices. Starting with NN==0
>
> as per the dumpxml output

<console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
</console>

I expected host:/dev/pts/1 is paired with guest:/dev/hvc0
So I tried to communicate with minicom,echo,cat with these two but I saw no
output. what I echo on /dev/pts/1 doesn't pass to /dev/hvc0 or vice verse.


>
> > Similar to console device I can add a Serial device but that requires a
> > reboot of the guest VM. However I tried that though I prefer to do it
> > without a guest restart.
> >
> > <serial type='pty'>
> >       <source path='/dev/pts/1'/>
> >       <target port='0'/>
> >       <alias name='serial0'/>
> >  </serial>
> >
> > here also I expected host:/dev/pts/1 is paired with /dev/ttyS0 but
> couldn't
> > communicate.
>
> The serial port device supported is a 1990 era ISA bus serial port
> so there's no hotplug for that. Only the paravirt consoles can be
> hotplugged.
>
> Regards,
> Daniel
> --
> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/
> :|
> |: http://libvirt.org              -o-             http://virt-manager.org
> :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/
> :|
> |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc
> :|
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20150327/c7a2391a/attachment.htm>


More information about the libvirt-users mailing list