[libvirt] qemu-agent-command via isa-serial for freebsd

Hi! I'm need to control freebsd guest via qemu-ga, as i see qemu-ga already supports isa-serial connection. How i need to configure domain via libvirt to able virsh qemu-agent-command to this guest vm? -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

On 28.10.2015 13:10, Vasiliy Tolstov wrote:
Hi! I'm need to control freebsd guest via qemu-ga, as i see qemu-ga already supports isa-serial connection. How i need to configure domain via libvirt to able virsh qemu-agent-command to this guest vm?
You need to have a virtio channel whose target name is "org.qemu.guest_agent.0". The source does not matter to libvirt - we can connect both to an unix socket or pty. Michal

2015-10-29 18:40 GMT+03:00 Michal Privoznik <mprivozn@redhat.com>:
You need to have a virtio channel whose target name is "org.qemu.guest_agent.0". The source does not matter to libvirt - we can connect both to an unix socket or pty.
Can you helps me via providing xml for this? Freebsd does not supports virtio-serial, so inside guest i need isa-serial (ttyS0 or ttyS1), and from host side something like unix socket with name org.qemu.guest_agent.0.. -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

On 30.10.2015 08:32, Vasiliy Tolstov wrote:
2015-10-29 18:40 GMT+03:00 Michal Privoznik <mprivozn@redhat.com>:
You need to have a virtio channel whose target name is "org.qemu.guest_agent.0". The source does not matter to libvirt - we can connect both to an unix socket or pty.
Can you helps me via providing xml for this? Freebsd does not supports virtio-serial, so inside guest i need isa-serial (ttyS0 or ttyS1), and from host side something like unix socket with name org.qemu.guest_agent.0..
Oh right, libvirt only know how to deal with channels. ISA serials are ignored when it comes to qemu-ga. The problem is that from looking at <serial/> we don't know which one is suppose to be for the agent. For instance: <serial type='pty'> <source path='/dev/pts/28'/> <target port='1'/> <alias name='serial1'/> </serial> <serial type='unix'> <source mode='bind' path='/tmp/serial.sock'/> <target port='0'/> <alias name='serial2'/> </serial> which one of these should be agent listening to? And subsequently which one should libvirt connect to? We can add an attribute somewhere to denote that fact, but you'd still need to configure the guest agent inside the guest to run properly. Michal

2015-10-30 13:00 GMT+03:00 Michal Privoznik <mprivozn@redhat.com>:
Oh right, libvirt only know how to deal with channels. ISA serials are ignored when it comes to qemu-ga. The problem is that from looking at <serial/> we don't know which one is suppose to be for the agent. For instance:
<serial type='pty'> <source path='/dev/pts/28'/> <target port='1'/> <alias name='serial1'/> </serial>
<serial type='unix'> <source mode='bind' path='/tmp/serial.sock'/> <target port='0'/> <alias name='serial2'/> </serial>
which one of these should be agent listening to? And subsequently which one should libvirt connect to?
We can add an attribute somewhere to denote that fact, but you'd still need to configure the guest agent inside the guest to run properly.
This is not problem - i'm create fallback (if virtio-serial is absent, try to isa-serial) Now i'm need only libvirt side, may be use alias name org.qemu.... to determine on which channel works qemu-ga ? -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

On 30.10.2015 11:04, Vasiliy Tolstov wrote:
2015-10-30 13:00 GMT+03:00 Michal Privoznik <mprivozn@redhat.com>:
Oh right, libvirt only know how to deal with channels. ISA serials are ignored when it comes to qemu-ga. The problem is that from looking at <serial/> we don't know which one is suppose to be for the agent. For instance:
<serial type='pty'> <source path='/dev/pts/28'/> <target port='1'/> <alias name='serial1'/> </serial>
<serial type='unix'> <source mode='bind' path='/tmp/serial.sock'/> <target port='0'/> <alias name='serial2'/> </serial>
which one of these should be agent listening to? And subsequently which one should libvirt connect to?
We can add an attribute somewhere to denote that fact, but you'd still need to configure the guest agent inside the guest to run properly.
This is not problem - i'm create fallback (if virtio-serial is absent, try to isa-serial) Now i'm need only libvirt side, may be use alias name org.qemu.... to determine on which channel works qemu-ga ?
Yeah, something like that could work. Mind proposing patch? Michal

2015-10-30 13:08 GMT+03:00 Michal Privoznik <mprivozn@redhat.com>:
Yeah, something like that could work. Mind proposing patch?
Maybe... Does it possible to get something like this: <serial type='unix'> <source mode='bind' path='/tmp/serial.sock'/> <target name='org.qemu....' port='0'/> <alias name='serial2'/> </serial> i'm not understand does target for serial can have name. qemuFindAgentConfig uses if (STREQ_NULLABLE(channel->target.name, "org.qemu.guest_agent.0")) { -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

On Fri, Oct 30, 2015 at 01:32:34PM +0300, Vasiliy Tolstov wrote:
2015-10-30 13:08 GMT+03:00 Michal Privoznik <mprivozn@redhat.com>:
Yeah, something like that could work. Mind proposing patch?
Maybe... Does it possible to get something like this:
<serial type='unix'> <source mode='bind' path='/tmp/serial.sock'/> <target name='org.qemu....' port='0'/> <alias name='serial2'/> </serial>
i'm not understand does target for serial can have name. qemuFindAgentConfig uses if (STREQ_NULLABLE(channel->target.name, "org.qemu.guest_agent.0")) {
That doesn't make sense to me. virtio channel can have a name, but isa serial cannot, that name wouldn't make sense. Also, how would you identify to which serial port to attach in the guest-agent?
-- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

2015-10-30 13:46 GMT+03:00 Martin Kletzander <mkletzan@redhat.com>:
That doesn't make sense to me. virtio channel can have a name, but isa serial cannot, that name wouldn't make sense. Also, how would you identify to which serial port to attach in the guest-agent?
Hm.. interesting question =) On guest syde i can try all ttyS* and check for guest-sync message, when i'm receive it on the ttyS it can be used to communication. -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

On 30.10.2015 11:46, Martin Kletzander wrote:
On Fri, Oct 30, 2015 at 01:32:34PM +0300, Vasiliy Tolstov wrote:
2015-10-30 13:08 GMT+03:00 Michal Privoznik <mprivozn@redhat.com>:
Yeah, something like that could work. Mind proposing patch?
Maybe... Does it possible to get something like this:
<serial type='unix'> <source mode='bind' path='/tmp/serial.sock'/> <target name='org.qemu....' port='0'/> <alias name='serial2'/> </serial>
i'm not understand does target for serial can have name. qemuFindAgentConfig uses if (STREQ_NULLABLE(channel->target.name, "org.qemu.guest_agent.0")) {
That doesn't make sense to me. virtio channel can have a name, but isa serial cannot, that name wouldn't make sense.
That's the reason why libvirt just doesn't deal with isa-serials as an interface to guest agent. My point is, we need a way in a array of <serials/> to find the correct one that qemu-ga is going to listen to.
Also, how would you identify to which serial port to attach in the guest-agent?
Right now, qemu-ga has -p switch, that allows you to pass the path it should listen to. In this case: qemu-ga -m isa-serial -p /dev/ttyS0 should do. I'm no *BSD-ian, but I bet it can be configured in their startup scripts. So the only question is, how to mark the correct <serial/> in the domain XML. Michal

2015-10-30 13:57 GMT+03:00 Michal Privoznik <mprivozn@redhat.com>:
Right now, qemu-ga has -p switch, that allows you to pass the path it should listen to. In this case:
qemu-ga -m isa-serial -p /dev/ttyS0
should do. I'm no *BSD-ian, but I bet it can be configured in their startup scripts.
So the only question is, how to mark the correct <serial/> in the domain XML.
Yes, so if we add name to serial - all works fine (simply need to add isa_serial type to one if. If that can'be done - i need to iterate over aliases or something like this... -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru
participants (3)
-
Martin Kletzander
-
Michal Privoznik
-
Vasiliy Tolstov