[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 3/7] qemu: Add transient disk handler to start and stop the gu
From: |
Masayoshi Mizuma |
Subject: |
[PATCH v2 3/7] qemu: Add transient disk handler to start and stop the guest |
Date: |
Fri, 28 Aug 2020 10:08:32 -0400 |
From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
The transient disk is attached before the guest starts.
Remove the transient disk when the guest does shutdown.
Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
---
src/qemu/qemu_process.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 126fabf5ef..5753258135 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -60,6 +60,7 @@
#include "qemu_firmware.h"
#include "qemu_backup.h"
#include "qemu_dbus.h"
+#include "qemu_snapshot.h"
#include "cpu/cpu.h"
#include "cpu/cpu_x86.h"
@@ -7000,6 +7001,10 @@ qemuProcessLaunch(virConnectPtr conn,
qemuProcessAutoDestroyAdd(driver, vm, conn) < 0)
goto cleanup;
+ VIR_DEBUG("Setting up transient disk");
+ if (qemuTransientCreatetDisk(driver, vm, asyncJob) < 0)
+ goto cleanup;
+
ret = 0;
cleanup:
@@ -7636,6 +7641,9 @@ void qemuProcessStop(virQEMUDriverPtr driver,
}
qemuBlockRemoveImageMetadata(driver, vm, disk->dst, disk->src);
+
+ if (disk->transient)
+ qemuTransientRemoveDisk(disk);
}
}
--
2.27.0
- [PATCH v2 0/7] qemu: implementation of transient disk option, Masayoshi Mizuma, 2020/08/28
- [PATCH v2 1/7] qemuSnapshotDiskPrepareOne: Get available even if snapdisk is NULL, Masayoshi Mizuma, 2020/08/28
- [PATCH v2 2/7] qemu: Introduce functions to handle transient disk, Masayoshi Mizuma, 2020/08/28
- [PATCH v2 4/7] qemu: Transient option gets avaiable for qcow2 and raw format disk, Masayoshi Mizuma, 2020/08/28
- [PATCH v2 3/7] qemu: Add transient disk handler to start and stop the guest,
Masayoshi Mizuma <=
- [PATCH v2 7/7] qemu: Block blockjobs when transient disk option is enabled, Masayoshi Mizuma, 2020/08/28
- [PATCH v2 5/7] qemu: Block migration when transient disk option is enabled, Masayoshi Mizuma, 2020/08/28
- [PATCH v2 6/7] qemu: Block disk hotplug when transient disk option is enabled, Masayoshi Mizuma, 2020/08/28
- Re: [PATCH v2 0/7] qemu: implementation of transient disk option, Ján Tomko, 2020/08/31