On Mon, Aug 13, 2018 at 05:59:58PM +0200, Peter Krempa wrote:
Node names for block objects in qemu need to be unique for an
instance
of the qemu process. Add a counter to generate objects sequentially and
store it in the status XML so that we can restore it.
The helpers added allow to create new node names and reset the counter
after the VM process terminates.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_domain.c | 38 ++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_domain.h | 6 ++++++
src/qemu/qemu_process.c | 3 +++
3 files changed, 47 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e5f055f203..032ad80baa 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2438,6 +2438,9 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf,
qemuDomainObjPrivateXMLFormatPR(buf, priv);
+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV))
+ virBufferAsprintf(buf, "<nodename next='%llu'/>\n",
priv->nodenameindex);
Given that it's icremented before usage, shouldn't this be
<nodename last='%llu'/>
or, to match the internal variable name:
<nodename index='%llu'/>
+
if (qemuDomainObjPrivateXMLFormatBlockjobs(buf, vm) < 0)
return -1;
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano