Setup all fields for use with -blockdev.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_domain.c | 11 ++++++++---
src/qemu/qemu_domain.h | 3 ++-
src/qemu/qemu_process.c | 2 +-
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 9ed2d1fd86..2f91bdf316 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -11308,7 +11308,8 @@ qemuDomainSupportsCheckpointsBlockjobs(virDomainObj *vm)
* 'libvirt-pflash1-format' for pflash1.
*/
int
-qemuDomainInitializePflashStorageSource(virDomainObj *vm)
+qemuDomainInitializePflashStorageSource(virDomainObj *vm,
+ virQEMUDriverConfig *cfg)
{
qemuDomainObjPrivate *priv = vm->privateData;
virDomainDef *def = vm->def;
@@ -11331,8 +11332,12 @@ qemuDomainInitializePflashStorageSource(virDomainObj *vm)
if (def->os.loader->nvram) {
- def->os.loader->nvram->nodeformat =
g_strdup("libvirt-pflash1-format");
- def->os.loader->nvram->nodestorage =
g_strdup("libvirt-pflash1-storage");
+ if (qemuDomainPrepareStorageSourceBlockdevNodename(NULL,
+ def->os.loader->nvram,
+ "libvirt-pflash1",
+ priv,
+ cfg) < 0)
+ return -1;
}
priv->pflash0 = g_steal_pointer(&pflash0);
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 0c6b3eeffa..36325259cc 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -1047,7 +1047,8 @@ int
qemuDomainMakeCPUMigratable(virCPUDef *cpu);
int
-qemuDomainInitializePflashStorageSource(virDomainObj *vm);
+qemuDomainInitializePflashStorageSource(virDomainObj *vm,
+ virQEMUDriverConfig *cfg);
bool
qemuDomainDiskBlockJobIsSupported(virDomainObj *vm,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 3334c7d536..09409b90b7 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6493,7 +6493,7 @@ qemuProcessPrepareDomain(virQEMUDriver *driver,
VIR_DEBUG("Prepare bios/uefi paths");
if (qemuFirmwareFillDomain(driver, vm->def, flags) < 0)
return -1;
- if (qemuDomainInitializePflashStorageSource(vm) < 0)
+ if (qemuDomainInitializePflashStorageSource(vm, cfg) < 0)
return -1;
VIR_DEBUG("Preparing external devices");
--
2.35.3