Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8A5AC9AC0 for ; Wed, 6 Mar 2013 18:00:12 +0000 (UTC) Received: (qmail 60569 invoked by uid 500); 6 Mar 2013 18:00:05 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 60540 invoked by uid 500); 6 Mar 2013 18:00:05 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 60430 invoked by uid 99); 6 Mar 2013 18:00:05 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Mar 2013 18:00:05 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 62407830B68; Wed, 6 Mar 2013 18:00:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bfederle@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [5/29] git commit: refs/heads/ui-multiple-nics - Summary: KVM - Add virtio-serial device to libvirt xml for system vms Message-Id: <20130306180005.62407830B68@tyr.zones.apache.org> Date: Wed, 6 Mar 2013 18:00:04 +0000 (UTC) Summary: KVM - Add virtio-serial device to libvirt xml for system vms Detail: This device can be used for remotely controlling the system vms through a local socket on the host. We will attempt to replace the KVM patchdisk with it. Tested, successfully deploys VM, and if system vm has proper driver it will create a /dev/vport0p1 device within the VM. We will be updating the system VM in 4.2/5.0 and will support this. Signed-off-by: Marcus Sorensen 1362527352 -0700 Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/d81f7156 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/d81f7156 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/d81f7156 Branch: refs/heads/ui-multiple-nics Commit: d81f7156dca5000e0e14a4a402c4e03a86ebbe2d Parents: 3375737 Author: Marcus Sorensen Authored: Tue Mar 5 16:49:12 2013 -0700 Committer: Marcus Sorensen Committed: Tue Mar 5 16:49:12 2013 -0700 ---------------------------------------------------------------------- .../kvm/resource/LibvirtComputingResource.java | 6 +++ .../hypervisor/kvm/resource/LibvirtVMDef.java | 25 +++++++++++++++ 2 files changed, 31 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d81f7156/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 5a96c36..3c848de 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -188,6 +188,7 @@ import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InputDef; import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef; import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef.hostNicType; import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.SerialDef; +import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.VirtioSerialDef; import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.TermPolicy; import com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk; import com.cloud.hypervisor.kvm.storage.KVMPhysicalDisk.PhysicalDiskFormat; @@ -3053,6 +3054,11 @@ ServerResource { SerialDef serial = new SerialDef("pty", null, (short) 0); devices.addDevice(serial); + if (vmTO.getType() != VirtualMachine.Type.User) { + VirtioSerialDef vserial = new VirtioSerialDef(vmTO.getName(), null); + devices.addDevice(vserial); + } + ConsoleDef console = new ConsoleDef("pty", null, null, (short) 0); devices.addDevice(console); http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d81f7156/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java index 5ab3770..fc3b5f6 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java @@ -846,6 +846,31 @@ public class LibvirtVMDef { } } + public static class VirtioSerialDef { + private final String _name; + private String _path; + + public VirtioSerialDef(String name, String path) { + _name = name; + _path = path; + } + + @Override + public String toString() { + StringBuilder virtioSerialBuilder = new StringBuilder(); + if(_path == null) { + _path = "/var/lib/libvirt/qemu"; + } + virtioSerialBuilder.append("\n"); + virtioSerialBuilder.append("\n"); + virtioSerialBuilder.append("\n"); + virtioSerialBuilder.append("
\n"); + virtioSerialBuilder.append("\n"); + return virtioSerialBuilder.toString(); + } + } + public static class GraphicDef { private final String _type; private short _port = -2;