Bug 887415 - Provide XML mode to autoallocate unix socket path for char device, helps apps with qemu-ga
Summary: Provide XML mode to autoallocate unix socket path for char device, helps apps...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michal Privoznik
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-15 00:51 UTC by Cole Robinson
Modified: 2013-05-06 16:57 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-05-06 16:57:25 UTC
Embargoed:


Attachments (Terms of Use)

Description Cole Robinson 2012-12-15 00:51:18 UTC
If you want to configure the qemu guest agent, a user/app has to add an XML block to the guest like:

    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/GUEST.agent'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
    </channel>

Having to hardcode a path like that sucks, because:

1) /var/lib/libvirt/qemu is not guarantee'd to be a correctly permissioned place to drop things, only libvirt knows for sure the best spot
2) All apps would have to duplicate some logic to generate a socket name that doesn't conflict with other VMs, and the app may not even be in a position to guarantee it doesn't conflict with the local FS.

It would be helpful if we could do something like

  <source mode='bind' autopath='on'/>

And libvirt would just fill in a path for us. Would also be a useful mode for VNC unix sockets as well.

Comment 1 Michal Privoznik 2013-02-13 15:19:47 UTC
Yeah, I agree that current way of configuring guest agent sucks. I think we should auto allocate path even without the 'autopath' attribute you are suggesting. Let me see if I can get this over upstream process.

Comment 2 Michal Privoznik 2013-04-09 17:06:25 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2013-April/msg00720.html

Comment 3 Michal Privoznik 2013-05-06 16:57:25 UTC
Patch pushed upstream:

commit 297c99a5676c32d3d98c08c24499271c52fbb3fb
Author:     Michal Privoznik <mprivozn>
AuthorDate: Tue Apr 9 19:04:00 2013 +0200
Commit:     Michal Privoznik <mprivozn>
CommitDate: Thu May 2 16:40:24 2013 +0200

    qemu: Generate agent socket path if missing
    
    It's not desired to force users imagine path for a socket they
    are not even supposed to connect to. On the other hand, we
    already have a release where the qemu agent socket path is
    exposed to XML, so we cannot silently drop it from there.
    The new path is generated in form:
    
    $LOCALSTATEDIR/lib/libvirt/qemu/channel/target/$domain.$name
    
    for qemu system mode, and
    
    $XDG_CONFIG_HOME/qemu/lib/channel/target/$domain.$name
    
    for qemu session mode.

v1.0.5-3-g297c99a


Note You need to log in before you can comment on or make changes to this bug.