From mboxrd@z Thu Jan 1 00:00:00 1970 From: tangchen Subject: [PATCH] virt: Add the parameter --vnclisten to the virt-install command Date: Fri, 30 Dec 2011 13:26:26 +0800 Message-ID: <4EFD4B82.9000809@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: autotest@test.kernel.org, kvm@vger.kernel.org To: Lucas Meneghel Rodrigues Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autotest-bounces@test.kernel.org Errors-To: autotest-bounces@test.kernel.org List-Id: kvm.vger.kernel.org Hi, My colleague happened to find that when installing a Guest, we cannot access to it by VNC because of the missing parameter "--vnclisten=0.0.0.0" in virt-install. Here is the patch, please comment! :) Signed-off-by: Gu Yanhua --- client/virt/libvirt_vm.py | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/client/virt/libvirt_vm.py b/client/virt/libvirt_vm.py index 65db338..4684aeb 100644 --- a/client/virt/libvirt_vm.py +++ b/client/virt/libvirt_vm.py @@ -287,6 +287,7 @@ class VM(virt_vm.BaseVM): self.serial_console = None self.redirs = {} self.vnc_port = 5900 + self.vnclisten = "0.0.0.0" self.pci_assignable = None self.netdev_id = [] self.device_id = [] @@ -298,6 +299,7 @@ class VM(virt_vm.BaseVM): self.params = params self.root_dir = root_dir self.address_cache = address_cache + self.vnclisten = "0.0.0.0" # For now, libvirt does not have a monitor property. self.monitor = None self.driver_type = params.get("driver_type", self.LIBVIRT_DEFAULT) @@ -489,6 +491,9 @@ class VM(virt_vm.BaseVM): def add_vnc(help, vnc_port): return " --vnc --vncport=%d" % (vnc_port) + + def add_vnclisten(help, vnclisten): + return " --vnclisten=%s " % (vnclisten) def add_sdl(help): if has_option(help, "sdl"): @@ -629,6 +634,9 @@ class VM(virt_vm.BaseVM): if params.get("vnc_port"): vm.vnc_port = int(params.get("vnc_port")) virt_install_cmd += add_vnc(help, vm.vnc_port) + if params.get("vnclisten"): + vm.vnclisten = params.get("vnclisten") + virt_install_cmd += add_vnclisten(help, vm.vnclisten) elif params.get("display") == "sdl": virt_install_cmd += add_sdl(help) elif params.get("display") == "nographic": -- 1.7.1 -- Best Regards, Tang chen