From 07675b0100da4b26a84bc53a7480b4293eb52543 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 15 Nov 2019 16:23:44 +0100 Subject: [PATCH] qemu: domain: Store virStorageSources representing pflash backing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To allow converting the pflash drives to blockdev we will need a virStorageSource to allow using our helpers. Temporarily prior to coverting loader data to a virStorageSoruce add private data which will house this. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrangé --- src/qemu/qemu_domain.c | 5 +++++ src/qemu/qemu_domain.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d56dfa9f00..174c780fed 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2167,6 +2167,11 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivatePtr priv) virHashRemoveAll(priv->blockjobs); virHashRemoveAll(priv->dbusVMStates); + + virObjectUnref(priv->pflash0); + priv->pflash0 = NULL; + virObjectUnref(priv->pflash1); + priv->pflash1 = NULL; } diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 98a9540275..a545edb022 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -397,6 +397,12 @@ struct _qemuDomainObjPrivate { virHashTablePtr dbusVMStates; bool disableSlirp; + + /* Until we add full support for backing chains for pflash drives, these + * pointers hold the temporary virStorageSources for creating the -blockdev + * commandline for pflash drives. */ + virStorageSourcePtr pflash0; + virStorageSourcePtr pflash1; }; #define QEMU_DOMAIN_PRIVATE(vm) \