On 21/04/22 8:36 pm, Peter Krempa wrote:
On Thu, Apr 21, 2022 at 16:52:54 +0200, Peter Krempa wrote:
On Fri, Apr 08, 2022 at 10:48:46 -0700, Rohit Kumar wrote:
Remote store NVRAM feature is being enabled only
if it supports 'blockdev' capability.
Signed-off-by: Prerna Saxena <prerna.saxena@xxxxxxxxxxx>
Signed-off-by: Florian Schmidt <flosch@xxxxxxxxxxx>
Signed-off-by: Rohit Kumar <rohit.kumar3@xxxxxxxxxxx>
---
src/qemu/qemu_validate.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 96f5427678..2a961b1f50 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -611,6 +611,25 @@ qemuValidateDomainDefBoot(const virDomainDef *def)
}
As noted in 2/8, this will need to be moved earlier.
Ack.
+static int
+qemuValidateDomainDefNvram(const virDomainDef *def,
+ virQEMUCaps *qemuCaps)
+{
Return early if there's nothing to validate to decrease indentation
level.
Ack.
+ if (def->os.loader && def->os.loader->nvram) {
+ if (def->os.loader->nvram->type != VIR_STORAGE_TYPE_FILE &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("This Qemu does not support 'blockdev' capability "
+ "for remote store NVRAM. NVRAM type other than "
+ "'file' is not supported with this QEMU"));
"Remote NVRAM is not supported by this qemu".
Ack. Thanks!
+ return -1;
+ }
+ }
Also you need to reject all the other unsupported configs here.
Sure. I will update it in the next patch. Thanks!
Additionally you'll also need to call the function that validates a
storage source definition too at this point.
Yes, I will add it. Thanks!