[libvirt] [PATCH v3 16/28] qemu: Format targetModel for serial devices

Andrea Bolognani abologna at redhat.com
Sun Nov 26 22:25:37 UTC 2017


Now that we've created a distinction between target type and target
model, with the latter being the concrete device name, it's time to
switch to formatting the model instead of the type.

Signed-off-by: Andrea Bolognani <abologna at redhat.com>
Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
---
 src/qemu/qemu_command.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 0a4684231..718dfb15f 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -10375,8 +10375,8 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
                               serial->info.alias);
         }
     } else {
-        switch ((virDomainChrSerialTargetType) serial->targetType) {
-        case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB:
+        switch ((virDomainChrSerialTargetModel) serial->targetModel) {
+        case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL:
             if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_SERIAL)) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                                _("usb-serial is not supported in this QEMU binary"));
@@ -10384,10 +10384,10 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
             }
             break;
 
-        case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA:
+        case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL:
             break;
 
-        case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI:
+        case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL:
             if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCI_SERIAL)) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                                _("pci-serial is not supported with this QEMU binary"));
@@ -10395,19 +10395,19 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
             }
             break;
 
-        case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE:
-        case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST:
+        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
              * be used, all of the above are platform devices, which means
              * qemuBuildSerialCommandLine() will have taken the appropriate
              * branch and we will not have ended up here. */
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("Invalid target type for serial device"));
+                           _("Invalid target model for serial device"));
             goto error;
         }
 
         virBufferAsprintf(&cmd, "%s,chardev=char%s,id=%s",
-                          virDomainChrSerialTargetTypeToString(serial->targetType),
+                          virDomainChrSerialTargetModelTypeToString(serial->targetModel),
                           serial->info.alias, serial->info.alias);
     }
 
-- 
2.14.3




More information about the libvir-list mailing list