From 335b834d956f029323a1eb342fd0b1e08f73fcb0 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: May 21 2015 15:49:02 +0000 Subject: Introduce pci-serial https://bugzilla.redhat.com/show_bug.cgi?id=998813 Like usb-serial, the pci-serial device allows a serial device to be attached to PCI bus. An example XML looks like this:
Signed-off-by: Michal Privoznik --- diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index eb3aacd..6d58a40 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5107,12 +5107,16 @@ qemu-kvm -net nic,model=? /dev/null specifies the port number. Ports are numbered starting from 0. There are usually 0, 1 or 2 serial ports. There is also an optional type attribute since 1.0.2 - which has two choices for its value, one is isa-serial, - the other is usb-serial. If type is missing, - isa-serial will be used by default. For usb-serial - an optional sub-element <address> with - type='usb' can tie the device to a particular controller, - documented above. + which has three choices for its value, one is isa-serial, + then usb-serial and last one is pci-serial. + If type is missing, isa-serial will be used by + default. For usb-serial an optional sub-element + <address/> with type='usb' can tie the + device to a particular controller, documented above. + Similarly, pci-serial can be used to attach the device to + the pci bus (since 1.2.16). Again, it has + optional sub-element <address/> with + type='pci' to select desired location on the PCI bus.

Console
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 64a094b..7c6fa5c 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3076,6 +3076,7 @@ isa-serial usb-serial + pci-serial diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 892d7d7..631f9eb 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -408,7 +408,8 @@ VIR_ENUM_IMPL(virDomainChrDeviceState, VIR_DOMAIN_CHR_DEVICE_STATE_LAST, VIR_ENUM_IMPL(virDomainChrSerialTarget, VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST, "isa-serial", - "usb-serial") + "usb-serial", + "pci-serial") VIR_ENUM_IMPL(virDomainChrChannelTarget, VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_LAST, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index f27f2e4..0fcf52e 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1068,6 +1068,7 @@ typedef enum { typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA = 0, VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI, VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST } virDomainChrSerialTargetType; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-serial-dev-chardev.xml b/tests/qemuxml2argvdata/qemuxml2argv-pci-serial-dev-chardev.xml new file mode 100644 index 0000000..a058e38 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-serial-dev-chardev.xml @@ -0,0 +1,37 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu + + + +
+ + + + + + + +
+ + + + +
+ + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 2c53d7c..53bcc9f 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -481,6 +481,7 @@ mymain(void) DO_TEST("hostdev-pci-address"); DO_TEST("hostdev-vfio"); DO_TEST("pci-rom"); + DO_TEST("pci-serial-dev-chardev"); DO_TEST("encrypted-disk"); DO_TEST_DIFFERENT("memtune");