Jean-Pierre Ribeauville
2015-Aug-25 15:17 UTC
[libvirt-users] On which /dev/pts/x is channel source mapped ?
Hi, By adding following lines in a Guest .xml conf file , I'm able to send / receive datas between host and this guest. <channel type='pty'> <target type='virtio' name='arbitrary.virtio.serial.port.name'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> My question is the following : How may I find to which /dev/pts/x is mapped the source path ( from the host point of view) ? I was able to find it by having a look in the virt manager GUI , but I want to do it programmatically. I've tried to force it by specifying a source path in the .xml file .... No way Thx for help. Regards, J.P. Ribeauville P: +33.(0).1.47.17.27.87 Puteaux 3 Etage 5 Bureau 4 jpribeauville@axway.com<mailto:jpribeauville@axway.com> http://www.axway.com<http://www.axway.com/> P Pensez à l'environnement avant d'imprimer.
Pierre Schweitzer
2015-Aug-26 11:58 UTC
Re: [libvirt-users] On which /dev/pts/x is channel source mapped ?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Dear Jean-Pierre, Here, at the ReactOS Foundation, we've hit the same issue with our automated regression testing using KVM (and thus, libvirt). The solution we use is that we first start the VM and then, we ask libvirt to dump the VM XML and we parse it to get the pts. I'm not sure whether that's the most efficient method, but at least, that's a method that works. You can have a look at our code which is GPLv2. It is available here: https://svn.reactos.org/svn/project-tools/trunk/sysreg2/ More specifically, the part where we ask again for the config happens in kvm.cpp, KVM class, in KVM::GetConsole() function. I hope it helps. If you need more information, don't hesitate to ask. Cheers, On 08/25/2015 05:17 PM, Jean-Pierre Ribeauville wrote:> Hi, > > By adding following lines in a Guest .xml conf file , I'm able to > send / receive datas between host and this guest. > > <channel type='pty'> <target type='virtio' > name='arbitrary.virtio.serial.port.name'/> <address > type='virtio-serial' controller='0' bus='0' port='1'/> </channel> > > My question is the following : > > How may I find to which /dev/pts/x is mapped the source path ( > from the host point of view) ? I was able to find it by having a > look in the virt manager GUI , but I want to do it > programmatically. > > I've tried to force it by specifying a source path in the .xml file > .... No way > > > Thx for help. > > Regards, > > J.P. Ribeauville > > > P: +33.(0).1.47.17.27.87 > > > Puteaux 3 Etage 5 Bureau 4 > > jpribeauville@axway.com<mailto:jpribeauville@axway.com> > http://www.axway.com<http://www.axway.com/> > > > > P Pensez à l'environnement avant d'imprimer. > > > > > > > _______________________________________________ libvirt-users > mailing list libvirt-users@redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-users >- -- Pierre Schweitzer <pierre@reactos.org> System & Network Administrator Senior Kernel Developer ReactOS Deutschland e.V. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJV3anSAAoJEHVFVWw9WFsL0U4P/iMk268VVB1WFX97xSsOKF/N NOIFqRX5aIjlS8Lv/zzY8PXIqWZz/VPn78tazQ/yNwNynCxwmD/Yy4HkQGb79DNU GFhgkadYw2ZEWZ6GWTKz7LVEukWeP2EX+hilKJr+spP9rjiXMJwe/FLFntQ0znri igvJk2wtYWM/wLdHMtJ3Z/xLO3Nm8ZvHDDO42snI6syCrRVPFw9Iih64JCJz18bv pWR8NqTWB+/SNdpejYSaL6p4CCx1qvSCSrjd3/i2rlXjdEeuzI1lCZT6oEcU8X0d 4lQ1Z22CNeu5dXDHOnRaqPc2V1Q0EehhSm8ZOqqv+lFwMCBDhc767rFRtZsh8y7N KRRt6TvoYk8lJ2czFMweHXvyXjDeHh5rwOs8jritUQDbTnZ9MGQI2Gtyl4JOzh9K klIvqG1BIlPnL1RetkyXfVjylXVD1kF18tGeMribBVWJ5F/+PCtJVCPG9oFqpvpz GRpUF1GpazRKl4Vu7NHPOu/NFrNUenYIABez0C8k7qsjx08K5AItsIQp2mVAJ6gz wY5m71KfL/FNj6YAa9LvFtufJsxwoR80PYyfBFXPUr6OLXSLMVXJsuoqULJ3QxI3 IlJAyWz19R8IBSSha1tcdd7KsM0G/yB6GAo/K+12BgAfWQvNXks6LUUKZ+Y0rdZF /wtl5/HzM10/b1TVQtHr =dpFP -----END PGP SIGNATURE-----
Daniel P. Berrange
2015-Aug-26 13:37 UTC
Re: [libvirt-users] On which /dev/pts/x is channel source mapped ?
On Tue, Aug 25, 2015 at 03:17:51PM +0000, Jean-Pierre Ribeauville wrote:> Hi, > > By adding following lines in a Guest .xml conf file , I'm able to send / receive datas between host and this guest. > > <channel type='pty'> > <target type='virtio' name='arbitrary.virtio.serial.port.name'/> > <address type='virtio-serial' controller='0' bus='0' port='1'/> > </channel> > > My question is the following : > > How may I find to which /dev/pts/x is mapped the source path ( from the host point of view) ?You have to queryy the XML from libvirt after the guest has started, at which point libvirt will have filled in the dynamically alllocated pty path. Honestly, you're probably better off not using type='pty', and instead use type='unix', which lets you specify an explicit UNIX domain socket path upfront, avoiding the whole problem. 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 :|