Re: [PATCH v3 12/12] qemu: Introduce qemuDomainDeviceDefValidateControllerSATA

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

 



On Wed, Dec 06, 2017 at 08:14:08PM -0500, John Ferlan wrote:
Move the SATA controller check from command line building to
controller def validation. This includes copying the SATA
skip check found in qemuBuildSkipController.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
src/qemu/qemu_command.c |  6 ------
src/qemu/qemu_domain.c  | 25 ++++++++++++++++++++++++-
2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 83431f458..f41b42aac 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2699,12 +2699,6 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
        break;

    case VIR_DOMAIN_CONTROLLER_TYPE_SATA:
-        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_AHCI)) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("SATA is not supported with this "
-                             "QEMU binary"));
-            goto error;
-        }
        virBufferAsprintf(&buf, "ahci,id=%s", def->info.alias);
        break;

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 0b2295129..159876279 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4285,6 +4285,25 @@ qemuDomainDeviceDefValidateControllerPCI(const virDomainControllerDef *controlle


static int
+qemuDomainDeviceDefValidateControllerSATA(const virDomainControllerDef *controller,
+                                          const virDomainDef *def,
+                                          virQEMUCapsPtr qemuCaps)
+{
+    /* first SATA controller on Q35 machines is implicit */
+    if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA &&

The type is _SATA, it's in the name fo this function

Jan

+        controller->idx == 0 && qemuDomainIsQ35(def))
+        return 0;
+
+    if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_AHCI)) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("SATA is not supported with this QEMU binary"));
+        return -1;
+    }
+    return 0;
+}
+
+
+static int
qemuDomainDeviceDefValidateController(const virDomainControllerDef *controller,
                                      const virDomainDef *def,
                                      virQEMUCapsPtr qemuCaps)

Attachment: signature.asc
Description: Digital signature

--
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