Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable qemu guest agent #242

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions oz/Guest.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,11 @@ def _generate_xml(self, bootdev, installdev, kernel=None, initrd=None,
install = oz.ozutil.lxml_subelement(devices, "disk", None, {'type':'file', 'device':installdev.devicetype})
oz.ozutil.lxml_subelement(install, "source", None, {'file':installdev.path})
oz.ozutil.lxml_subelement(install, "target", None, {'dev':installdev.bus})
# qemu-ga
channel = oz.ozutil.lxml_subelement(devices, "channel", None, {'type':'unix'})
source_path = "/var/lib/libvirt/qemu/%s.%s.sock" % ("org.qemu.guest_agent.0", self.tdl.name)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea, but I have a question. Will the hard-coded /var/lib/libvirt/qemu path work for non-root installations?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks clalancette!

  1. libivrt is a daemon running with root permission
  2. I checked this path on my environment(Centos 7.3), its belong to qemu:qemu(this really make sense, cause it used by qemu directly)

oz.ozutil.lxml_subelement(channel, "source", None, {'mode':'bind', 'path':source_path})
oz.ozutil.lxml_subelement(channel, "target", None, {'type':'virtio', 'name':'org.qemu.guest_agent.0'})

xml = lxml.etree.tostring(domain, pretty_print=True)
self.log.debug("Generated XML:\n%s", xml)
Expand Down