Re: [PATCH v2 06/11] qemu: assign addresses to virtio devices on RISC-V

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

 



On Thu, 2018-06-14 at 22:32 +0200, Lubomir Rintel wrote:
[...]
> +static void
> +qemuDomainAssignRISCVVirtioMMIOAddresses(virDomainDefPtr def,
> +                                         virQEMUCapsPtr qemuCaps)
> +{
> +    if (!ARCH_IS_RISCV(def->os.arch))
> +        return;
> +
> +    if (STRNEQ(def->os.machine, "virt"))
> +        return;

This will stop working the moment QEMU introduces versioned
machine types for RISC-V, which makes it not very future proof.

You should instead introduce (in a separate, earlier patch)

  qemuDomainIsRISCVVirt()
  qemuDomainMachineIsRISCVVirt()

functions modeled after the Arm equivalent, and use the former
here.

[...]
> @@ -2940,6 +2957,8 @@ qemuDomainAssignAddresses(virDomainDefPtr def,
>  
>      qemuDomainAssignARMVirtioMMIOAddresses(def, qemuCaps);
>  
> +    qemuDomainAssignRISCVVirtioMMIOAddresses(def, qemuCaps);

We should have a

  qemuDomainAssignVirtioMMIOAddresses()

wrapper that calls both the Arm and RISC-V variants, and call
that one from qemuDomainAssignAddresses().

You can introduce and start using the wrapper in a separate patch;
then, in this one, you can add the RISC-V variant and modify the
wrapper so that it calls it in addition to the Arm variant.

Everything else looks good.

-- 
Andrea Bolognani / Red Hat / Virtualization

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