|
|
c401cc |
From e813a5e84a4100278276b4202577a8b12c6ae891 Mon Sep 17 00:00:00 2001
|
|
|
c401cc |
Message-Id: <e813a5e84a4100278276b4202577a8b12c6ae891@dist-git>
|
|
|
c401cc |
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
c401cc |
Date: Wed, 26 Feb 2014 14:55:10 +0100
|
|
|
c401cc |
Subject: [PATCH] qemu: snapshot: Fix incorrect disk type for auto-generated
|
|
|
c401cc |
disks
|
|
|
c401cc |
|
|
|
c401cc |
https://bugzilla.redhat.com/show_bug.cgi?id=1032370
|
|
|
c401cc |
|
|
|
c401cc |
When changing the parsing and formatting functions in commit
|
|
|
c401cc |
43f2ccdc73090bd03f64de4d58d46ffa0134d705 I forgot to update the qemu
|
|
|
c401cc |
disk alignment function for snapshots that automatically adds snapshot
|
|
|
c401cc |
configs for disks that were not mentioned in the XML. The function
|
|
|
c401cc |
allocated a new disk snapshot definition but did not correctly
|
|
|
c401cc |
initialize the snapshot disk source type variable. This resulted into
|
|
|
c401cc |
the disks considered as block devices and invalid XML was generated.
|
|
|
c401cc |
|
|
|
c401cc |
Reported by John Ferlan.
|
|
|
c401cc |
|
|
|
c401cc |
(cherry picked from commit dafdea74b06655c1bf44d06ba040f85b8743164b)
|
|
|
c401cc |
|
|
|
c401cc |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
c401cc |
---
|
|
|
c401cc |
src/conf/snapshot_conf.c | 10 ++++++++++
|
|
|
c401cc |
1 file changed, 10 insertions(+)
|
|
|
c401cc |
|
|
|
c401cc |
diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
|
|
|
c401cc |
index a1fd723..3a7ed5d 100644
|
|
|
c401cc |
--- a/src/conf/snapshot_conf.c
|
|
|
c401cc |
+++ b/src/conf/snapshot_conf.c
|
|
|
c401cc |
@@ -495,6 +495,7 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr def,
|
|
|
c401cc |
goto cleanup;
|
|
|
c401cc |
disk->index = i;
|
|
|
c401cc |
disk->snapshot = def->dom->disks[i]->snapshot;
|
|
|
c401cc |
+ disk->type = -1;
|
|
|
c401cc |
if (!disk->snapshot)
|
|
|
c401cc |
disk->snapshot = default_snapshot;
|
|
|
c401cc |
}
|
|
|
c401cc |
@@ -512,6 +513,15 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr def,
|
|
|
c401cc |
const char *tmp;
|
|
|
c401cc |
struct stat sb;
|
|
|
c401cc |
|
|
|
c401cc |
+ if (disk->type != VIR_DOMAIN_DISK_TYPE_FILE &&
|
|
|
c401cc |
+ disk->type != -1) {
|
|
|
c401cc |
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
|
c401cc |
+ _("cannot generate external snapshot name "
|
|
|
c401cc |
+ "for disk '%s' on a '%s' device"),
|
|
|
c401cc |
+ disk->name, virDomainDiskTypeToString(disk->type));
|
|
|
c401cc |
+ goto cleanup;
|
|
|
c401cc |
+ }
|
|
|
c401cc |
+
|
|
|
c401cc |
if (!original) {
|
|
|
c401cc |
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
|
c401cc |
_("cannot generate external snapshot name "
|
|
|
c401cc |
--
|
|
|
c401cc |
1.9.0
|
|
|
c401cc |
|