[PATCH 1/9] conf: add an option to specify a NS16550A serial port

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



QEMU attaches this to a riscv/virt board. It's perhaps the same thing as
used on x86/pc, somewhat unfortunately called model="isa-serial".

Signed-off-by: Lubomir Rintel <lkundrak@xxxxx>
---
 docs/schemas/domaincommon.rng | 1 +
 src/conf/domain_conf.c        | 1 +
 src/conf/domain_conf.h        | 1 +
 src/qemu/qemu_command.c       | 2 ++
 src/qemu/qemu_domain.c        | 5 ++++-
 5 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index ff539607cc..47d4ee28ff 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3631,6 +3631,7 @@
           <value>pci-serial</value>
           <value>spapr-vty</value>
           <value>pl011</value>
+          <value>ns16550a</value>
           <value>sclpconsole</value>
           <value>sclplmconsole</value>
         </choice>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d38a775f21..119a074a0a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -486,6 +486,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTargetModel,
               "pci-serial",
               "spapr-vty",
               "pl011",
+              "ns16550a",
               "sclpconsole",
               "sclplmconsole",
 );
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 07d04fb2f9..c00293a07b 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1125,6 +1125,7 @@ typedef enum {
     VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL,
     VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY,
     VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011,
+    VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NS16550A,
     VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE,
     VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE,
 
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 0727361f19..f91d3ae5ac 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -8909,6 +8909,7 @@ qemuChrSerialTargetModelToCaps(virDomainChrSerialTargetModel targetModel)
         return QEMU_CAPS_DEVICE_SCLPLMCONSOLE;
     case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011:
         return QEMU_CAPS_DEVICE_PL011;
+    case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NS16550A:
     case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE:
     case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST:
         break;
@@ -10200,6 +10201,7 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
         break;
 
     case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011:
+    case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NS16550A:
     case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE:
     case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST:
         /* Except from _LAST, which is just a guard value and will never
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 8d0ab9788f..97633bfbb9 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3724,6 +3724,7 @@ qemuDomainChrSerialTargetModelToTargetType(int targetModel)
     case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY:
         return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO;
     case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011:
+    case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NS16550A:
         return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM;
     case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE:
     case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE:
@@ -3787,6 +3788,7 @@ qemuDomainChrTargetDefValidate(const virDomainChrDef *chr)
         case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL:
         case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY:
         case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011:
+        case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NS16550A:
         case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE:
         case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE:
 
@@ -3847,7 +3849,8 @@ qemuDomainChrDefValidate(const virDomainChrDef *dev,
 
         if (!qemuDomainIsVirt(def) &&
             (dev->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM ||
-             dev->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011)) {
+             dev->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011 ||
+             dev->targetModel == VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NS16550A)) {
             isCompatible = false;
         }
 
-- 
2.17.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux