Discussion:
[libvirt] qemu-agent-command via isa-serial for freebsd
Vasiliy Tolstov
2015-10-28 12:10:52 UTC
Permalink
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: ***@selfip.ru
Michal Privoznik
2015-10-29 15:40:42 UTC
Permalink
Post by Vasiliy Tolstov
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
Vasiliy Tolstov
2015-10-30 07:32:52 UTC
Permalink
Post by Michal Privoznik
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: ***@selfip.ru
Michal Privoznik
2015-10-30 10:00:32 UTC
Permalink
Post by Vasiliy Tolstov
Post by Michal Privoznik
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
Vasiliy Tolstov
2015-10-30 10:04:05 UTC
Permalink
Post by Michal Privoznik
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
<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: ***@selfip.ru
Michal Privoznik
2015-10-30 10:08:05 UTC
Permalink
Post by Vasiliy Tolstov
Post by Michal Privoznik
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
<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
Vasiliy Tolstov
2015-10-30 10:32:34 UTC
Permalink
Post by Michal Privoznik
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: ***@selfip.ru
Martin Kletzander
2015-10-30 10:46:26 UTC
Permalink
Post by Vasiliy Tolstov
Post by Michal Privoznik
Yeah, something like that could work. Mind proposing patch?
Maybe...
<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?
Post by Vasiliy Tolstov
--
Vasiliy Tolstov,
--
libvir-list mailing list
https://www.redhat.com/mailman/listinfo/libvir-list
Vasiliy Tolstov
2015-10-30 10:53:00 UTC
Permalink
Post by Martin Kletzander
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: ***@selfip.ru
Michal Privoznik
2015-10-30 10:57:43 UTC
Permalink
Post by Martin Kletzander
Post by Vasiliy Tolstov
Post by Michal Privoznik
Yeah, something like that could work. Mind proposing patch?
Maybe...
<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.
Post by Martin Kletzander
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
Vasiliy Tolstov
2015-10-30 11:03:50 UTC
Permalink
Post by Michal Privoznik
Right now, qemu-ga has -p switch, that allows you to pass the path it
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: ***@selfip.ru
Loading...