Jean-Pierre Ribeauville
2015-Aug-26 14:13 UTC
Re: [libvirt-users] On which /dev/pts/x is channel source
Hi, I just tested by using "unix virtio" channel instead of pty. It looks easier to handle. Thx for help. Regards, J.P. -----Message d'origine----- De : libvirt-users-bounces@redhat.com [mailto:libvirt-users-bounces@redhat.com] De la part de libvirt-users-request@redhat.com Envoyé : mercredi 26 août 2015 15:38 À : libvirt-users@redhat.com Objet : libvirt-users Digest, Vol 68, Issue 26 Send libvirt-users mailing list submissions to libvirt-users@redhat.com To subscribe or unsubscribe via the World Wide Web, visit https://www.redhat.com/mailman/listinfo/libvirt-users or, via email, send a message with subject or body 'help' to libvirt-users-request@redhat.com You can reach the person managing the list at libvirt-users-owner@redhat.com When replying, please edit your Subject line so it is more specific than "Re: Contents of libvirt-users digest..." Today's Topics: 1. Isolated networks && test lab (Spanky Horawitz) 2. Re: On which /dev/pts/x is channel source mapped ? (Pierre Schweitzer) 3. Virtio serial exposition (Jean-Pierre Ribeauville) 4. Re: On which /dev/pts/x is channel source mapped ? (Daniel P. Berrange) ---------------------------------------------------------------------- Message: 1 Date: Tue, 25 Aug 2015 17:17:56 -0700 From: Spanky Horawitz <shorawitz@gmail.com> To: libvirt-users@redhat.com Subject: [libvirt-users] Isolated networks && test lab Message-ID: <1440548276.17239.68.camel@psdchristensen> Content-Type: text/plain; charset="utf-8" I'm trying to migrate my VirtualBox test lab to KVM. In my VB configuration, I have several VM routers with 4 interfaces each. Each router has a bridged interface which connects them all together and to the outside world. I have servers/clients dispersed on each of the other private (Isolated) segments that use the routers as default gateways. In trying to make this work, I used Virtual Machine Manager to define 3x Virtual Networks (Isolated networks) and created a VM router which has 3 interfaces (192.168.x.1) on each Isolated network and a 4th interface using the br0 interface to get to the outside world. The router is able to connect to the outside world. Using Virtual Machine Manager, I also created "client" VM and connected it's single interface to one of the Isolated networks. While testing connectivity of the "client" VM to the router, it seems to go straight to the Host (tested using 'ssh 192.168.x.1'.) I'm trying to isolate the networks from the Host and have the router receive packets for the 192.168.x.1 address on the individual Isolated network segments. Host: br0 (em1): 192.168.1.16 vibr0 (default): 192.168.122.1 virbr1: 192.168.2.1 virbr2: 192.168.3.1 virbr3: 192.168.4.1 VM router: eth0: 192.168.1.10 eth1: 192.168.2.1 eth2: 192.168.3.1 eth3: 192.168.4.1 VM client: eth0: 192.168.3.101 Is there some trick to isolate the Host from the VM's? Is there a comprehensive guide that explains how the networks should be setup (with/without Virtual Machine Manager)? I'm not afraid to get my hands dirty on the console if needed, but GUI's are easier to navigate when you're learning a new technology. I switched to using RemoteBox for managing my VB vm's as it made things a lot easier to deal with than VBoxManage. Thanks for your help! -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://www.redhat.com/archives/libvirt-users/attachments/20150825/a054b278/attachment.html> ------------------------------ Message: 2 Date: Wed, 26 Aug 2015 13:58:10 +0200 From: Pierre Schweitzer <pierre@reactos.org> To: Jean-Pierre Ribeauville <jpribeauville@axway.com>, "libvirt-users@redhat.com" <libvirt-users@redhat.com> Subject: Re: [libvirt-users] On which /dev/pts/x is channel source mapped ? Message-ID: <55DDA9D2.40101@reactos.org> Content-Type: text/plain; charset=windows-1252 -----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----- ------------------------------ Message: 3 Date: Wed, 26 Aug 2015 12:17:20 +0000 From: Jean-Pierre Ribeauville <jpribeauville@axway.com> To: "libvirt-users@redhat.com" <libvirt-users@redhat.com> Subject: [libvirt-users] Virtio serial exposition Message-ID: <1051EFB4D3A1704680C38CCAAC5836D279B89B36@WPTXMAIL1.ptx.axway.int> Content-Type: text/plain; charset="iso-8859-1" Hi, I try to exchange datas between host and Guest by adding these lines in a guest .xml conf file : <channel type='pty'> <target type='virtio' name='arbitrary.virtio.serial.port.name'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> Then /dev/virtio-ports/arbitrary.virtio.serial.port.name is exposed in the guest and a /dev/pts/x is seen as source path on the host. I checked that on two Linux hosts : 1) libvirt-daemon-driver-qemu-1.2.8-16.el7_1.3.x86_64 qemu-kvm-1.5.3-86.el7_1.5.x86_64 qemu-kvm-common-1.5.3-86.el7_1.5.x86_64 qemu-guest-agent-2.1.0-4.el7.x86_64 ipxe-roms-qemu-20130517-6.gitc4bce43.el7.noarch qemu-img-1.5.3-86.el7_1.5.x86_64 Linux sparring 3.10.0-229.el7.x86_64 #1 SMP Thu Jan 29 18:37:38 EST 2015 x86_64 x86_64 x86_64 GNU/Linux 2) qemu-img-0.12.1.2-2.415.el6.x86_64 qemu-kvm-0.12.1.2-2.415.el6.x86_64 gpxe-roms-qemu-0.9.7-6.10.el6.noarch Linux orion 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux The device is only exposed on the guest of the first host . Is it due to a too old version of qemu and/or Linux on the second host or some packages missing on this second host ? Thx. 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://www.redhat.com/archives/libvirt-users/attachments/20150826/34120e86/attachment.html> ------------------------------ Message: 4 Date: Wed, 26 Aug 2015 14:37:47 +0100 From: "Daniel P. Berrange" <berrange@redhat.com> To: Jean-Pierre Ribeauville <jpribeauville@axway.com> Cc: "libvirt-users@redhat.com" <libvirt-users@redhat.com> Subject: Re: [libvirt-users] On which /dev/pts/x is channel source mapped ? Message-ID: <20150826133747.GM21787@redhat.com> Content-Type: text/plain; charset=utf-8 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 :| ------------------------------ _______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users End of libvirt-users Digest, Vol 68, Issue 26 *********************************************