From 322d21251630d16ab6664477c10d7442d9f222e7 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 18 Jul 2016 15:03:06 -0400 Subject: [PATCH] cli: Add --serial log.file= and log.append= And for other character devices --console, --parallel, --channel --- tests/cli-test-xml/compare/virt-install-many-devices.xml | 1 + tests/clitest.py | 2 +- virtinst/cli.py | 2 ++ virtinst/devicechar.py | 3 +++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/cli-test-xml/compare/virt-install-many-devices.xml b/tests/cli-test-xml/compare/virt-install-many-devices.xml index 50859f34b..cc98309e6 100644 --- a/tests/cli-test-xml/compare/virt-install-many-devices.xml +++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml @@ -244,6 +244,7 @@ + diff --git a/tests/clitest.py b/tests/clitest.py index b63a92a7c..4bcd85c15 100644 --- a/tests/clitest.py +++ b/tests/clitest.py @@ -490,7 +490,7 @@ c.add_compare(""" \ --input type=keyboard,bus=usb \ --input tablet \ \ ---serial tcp,host=:2222,mode=bind,protocol=telnet \ +--serial tcp,host=:2222,mode=bind,protocol=telnet,log_file=/tmp/foo.log,log_append=yes \ --parallel udp,host=0.0.0.0:1234,bind_host=127.0.0.1:1234 \ --parallel unix,path=/tmp/foo-socket \ --channel pty,target_type=guestfwd,target_address=127.0.0.1:10000 \ diff --git a/virtinst/cli.py b/virtinst/cli.py index 432640b1e..5e886cc40 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -2370,6 +2370,8 @@ _ParserChar.add_arg(None, "host", cb=_ParserChar.set_host_cb) _ParserChar.add_arg(None, "bind_host", cb=_ParserChar.set_bind_cb) _ParserChar.add_arg(None, "target_address", cb=_ParserChar.set_target_cb) _ParserChar.add_arg("source_mode", "mode") +_ParserChar.add_arg("log_file", "log.file") +_ParserChar.add_arg("log_append", "log.append", is_onoff=True) diff --git a/virtinst/devicechar.py b/virtinst/devicechar.py index 8ade61b6c..a711c5bd9 100644 --- a/virtinst/devicechar.py +++ b/virtinst/devicechar.py @@ -281,6 +281,9 @@ class _VirtualCharDevice(VirtualDevice): doc=_("Sysfs name of virtio port in the guest"), default_cb=_default_target_name) + log_file = XMLProperty("./log/@file") + log_append = XMLProperty("./log/@append", is_onoff=True) + class VirtualConsoleDevice(_VirtualCharDevice): virtual_device_type = "console"