[ https://issues.apache.org/jira/browse/CLOUDSTACK-8715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15672509#comment-15672509 ]
ASF GitHub Bot commented on CLOUDSTACK-8715: -------------------------------------------- Github user jburwell commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1545#discussion_r88378673 --- Diff: plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java --- @@ -1209,25 +1209,95 @@ public String toString() { } } - public static class VirtioSerialDef { - private final String _name; - private String _path; + public static class ChannelDef { + enum ChannelType { + UNIX("unix"), SERIAL("serial"); + String type; - public VirtioSerialDef(String name, String path) { - _name = name; - _path = path; + ChannelType(String type) { + this.type = type; + } + + @Override + public String toString() { + return this.type; + } + } + + enum ChannelState { + DISCONNECTED("disconnected"), CONNECTED("connected"); + String type; + + ChannelState(String type) { + this.type = type; + } + + @Override + public String toString() { + return type; + } + } + + private String name; + private String path; + private ChannelType type; + private ChannelState state; + + public ChannelDef(String name, ChannelType type) { + this.name = name; + this.type = type; + } + + public ChannelDef(String name, ChannelType type, String path) { + this.name = name; + this.path = path; + this.type = type; + } + + public ChannelDef(String name, ChannelType type, ChannelState state) { + this.name = name; + this.state = state; + this.type = type; + } + + public ChannelDef(String name, ChannelType type, ChannelState state, String path) { + this.name = name; + this.path = path; + this.state = state; + this.type = type; + } + + public ChannelType getChannelType() { + return type; + } + + public ChannelState getChannelState() { + return state; + } + + public String getName() { + return name; + } + + public String getPath() { + return path; } @Override public String toString() { StringBuilder virtioSerialBuilder = new StringBuilder(); - if (_path == null) { - _path = "/var/lib/libvirt/qemu"; + virtioSerialBuilder.append("<channel type='" + type.toString() + "'>\n"); --- End diff -- @wido have you had a chance to consider this comment? > Add support for qemu-guest-agent to libvirt provider > ---------------------------------------------------- > > Key: CLOUDSTACK-8715 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8715 > Project: CloudStack > Issue Type: New Feature > Security Level: Public(Anyone can view this level - this is the > default.) > Components: KVM > Reporter: Sten Spans > Assignee: Wido den Hollander > Labels: kvm, libvirt, qemu, systemvm > Fix For: Future > > > The qemu guest agent is a newer part of qemu/kvm/libvirt which exposes quite > a lot of useful functionality, which can only be provided by having an agent > on the VM. This includes things like freezing/thawing filesystems (for > backups), reading files on the guest, listing interfaces / ip addresses, etc. > This feature has been requested by users, but is currently not implemented. > http://users.cloudstack.apache.narkive.com/3TTmy3zj/enabling-qemu-guest-agent > The first change needed is to add the following to the XML generated for KVM > virtual machines,: > <channel type='unix'> > <source mode='bind'/> > <target type='virtio' name='org.qemu.guest_agent.0'/> > </channel> > This provides the communication channel between libvirt and the agent on the > host. All in all a pretty simple change to LibvirtComputingResource.java / > LibvirtVMDef.java > Secondly the qemu-guest-agent package needs to be added to the systemvm > template. -- This message was sent by Atlassian JIRA (v6.3.4#6332)