On 07/21/2017 06:52 AM, Andrea Bolognani wrote:
On Thu, 2017-07-20 at 13:56 -0600, dann frazier wrote:
> @@ -131,6 +131,8 @@ void qemuDomainCmdlineDefFree(qemuDomainCmdlineDefPtr def)
> #define VIR_QEMU_OVMF_SEC_NVRAM_PATH "/usr/share/OVMF/OVMF_VARS.fd"
> #define VIR_QEMU_AAVMF_LOADER_PATH "/usr/share/AAVMF/AAVMF_CODE.fd"
> #define VIR_QEMU_AAVMF_NVRAM_PATH "/usr/share/AAVMF/AAVMF_VARS.fd"
> +#define VIR_QEMU_AAVMF32_LOADER_PATH "/usr/share/AAVMF/AAVMF32_CODE.fd"
> +#define VIR_QEMU_AAVMF32_NVRAM_PATH "/usr/share/AAVMF/AAVMF32_VARS.fd"
>
> virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
> {
> @@ -335,11 +337,11 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
> goto error;
>
> #else
> - if (VIR_ALLOC_N(cfg->firmwares, 3) < 0)
> + if (VIR_ALLOC_N(cfg->firmwares, 4) < 0)
> goto error;
> - cfg->nfirmwares = 3;
> + cfg->nfirmwares = 4;
> if (VIR_ALLOC(cfg->firmwares[0]) < 0 || VIR_ALLOC(cfg->firmwares[1])
< 0 ||
> - VIR_ALLOC(cfg->firmwares[2]) < 0)
> + VIR_ALLOC(cfg->firmwares[2]) < 0 || VIR_ALLOC(cfg->firmwares[3])
< 0)
> goto error;
>
> if (VIR_STRDUP(cfg->firmwares[0]->name, VIR_QEMU_AAVMF_LOADER_PATH) <
0 ||
> @@ -347,7 +349,9 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
> VIR_STRDUP(cfg->firmwares[1]->name, VIR_QEMU_OVMF_LOADER_PATH) < 0
||
> VIR_STRDUP(cfg->firmwares[1]->nvram, VIR_QEMU_OVMF_NVRAM_PATH) < 0
||
> VIR_STRDUP(cfg->firmwares[2]->name, VIR_QEMU_OVMF_SEC_LOADER_PATH)
< 0 ||
> - VIR_STRDUP(cfg->firmwares[2]->nvram, VIR_QEMU_OVMF_SEC_NVRAM_PATH)
< 0)
> + VIR_STRDUP(cfg->firmwares[2]->nvram, VIR_QEMU_OVMF_SEC_NVRAM_PATH)
< 0 ||
> + VIR_STRDUP(cfg->firmwares[3]->name, VIR_QEMU_AAVMF32_LOADER_PATH) <
0 ||
> + VIR_STRDUP(cfg->firmwares[3]->nvram, VIR_QEMU_AAVMF32_NVRAM_PATH) <
0)
> goto error;
> #endif
Not your fault of course, but the way this is done at the
moment is *extremely* yucky.
I just posted a patch[1] that makes it saner, and although I
realize that's a bit more work I'd ask you to wait for it to
land in master and then respin on top of it.
IMO: Probably should have had Dann's patch go first, then do the
adjustment. Water under the bridge though...
So in order to make progress and since it was a simple modification, I
updated Dann's code to utilize the new model in qemu_conf.c from commit
id '6c2c04e75':
# define DEFAULT_LOADER_NVRAM \
"/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd:" \
"/usr/share/OVMF/OVMF_CODE.secboot.fd:/usr/share/OVMF/OVMF_VARS.fd:" \
"/usr/share/AAVMF/AAVMF_CODE.fd:/usr/share/AAVMF/AAVMF_VARS.fd:" \
"/usr/share/AAVMF/AAVMF32_CODE.fd:/usr/share/AAVMF/AAVMF32_VARS.fd"
Since there's another "looks good though" - I've pushed this to master
(and now pray that some CI build doesn't break ;-))
John
Congrats on your first libvirt patch
Everything else looks good though :)
[1]
https://www.redhat.com/archives/libvir-list/2017-July/msg00870.html
--
Andrea Bolognani / Red Hat / Virtualization