From 5addacc79b2ec0c73ea54505aa0c0c0fb0fe06e4 Mon Sep 17 00:00:00 2001 From: yan97ao Date: Wed, 6 Sep 2017 13:49:00 +0800 Subject: [PATCH] enable qemu guest agent --- oz/Guest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/oz/Guest.py b/oz/Guest.py index 048c3078..8c2fa3b5 100644 --- a/oz/Guest.py +++ b/oz/Guest.py @@ -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) + 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)