use suggested upstream version of 0001-launch-appliance-is-optional.patch
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=127
This commit is contained in:
parent
78fcab96fa
commit
73c4e38eee
@ -1,6 +1,6 @@
|
|||||||
From 7abe52ae73d918b515098842b19cb54888729b72 Mon Sep 17 00:00:00 2001
|
From f93f1538649d96d1b11eb7a4368aac0496acc2bc Mon Sep 17 00:00:00 2001
|
||||||
From: Olaf Hering <olaf@aepfle.de>
|
From: Olaf Hering <olaf@aepfle.de>
|
||||||
Date: Mon, 8 Oct 2012 19:51:38 +0200
|
Date: Mon, 8 Oct 2012 20:10:36 +0200
|
||||||
Subject: [PATCH] launch: appliance is optional
|
Subject: [PATCH] launch: appliance is optional
|
||||||
|
|
||||||
# virt-filesystems -v -d 6326ad4e-5805-2ab4-1338-d1dad8c76162 --all
|
# virt-filesystems -v -d 6326ad4e-5805-2ab4-1338-d1dad8c76162 --all
|
||||||
@ -18,24 +18,57 @@ libguestfs: closing guestfs handle 0x656270 (state 0)
|
|||||||
|
|
||||||
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
||||||
---
|
---
|
||||||
src/launch-libvirt.c | 4 ++++
|
src/launch-libvirt.c | 22 ++++++++++++++--------
|
||||||
1 Datei geändert, 4 Zeilen hinzugefügt(+)
|
1 file changed, 14 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
|
diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
|
||||||
index d678266..5914642 100644
|
index 5b7897d..183008e 100644
|
||||||
--- a/src/launch-libvirt.c
|
--- a/src/launch-libvirt.c
|
||||||
+++ b/src/launch-libvirt.c
|
+++ b/src/launch-libvirt.c
|
||||||
@@ -936,6 +936,10 @@ construct_libvirt_xml_appliance (guestfs_h *g, xmlTextWriterPtr xo,
|
@@ -194,10 +194,13 @@ launch_libvirt (guestfs_h *g, const char *libvirt_uri)
|
||||||
char drive_name[64] = "sd";
|
|
||||||
char scsi_target[64];
|
|
||||||
|
|
||||||
+ /* appliance is optional */
|
/* Create overlays for read-only drives and the appliance. This
|
||||||
+ if (appliance == NULL)
|
* works around lack of support for <transient/> disks in libvirt.
|
||||||
+ return 0;
|
+ * Note that appliance can be NULL if using the old-style appliance.
|
||||||
+
|
*/
|
||||||
guestfs___drive_name (drv_index, &drive_name[2]);
|
- appliance_overlay = make_qcow2_overlay (g, appliance, "raw");
|
||||||
snprintf (scsi_target, sizeof scsi_target, "%zu", drv_index);
|
- if (!appliance_overlay)
|
||||||
|
- goto cleanup;
|
||||||
|
+ if (appliance) {
|
||||||
|
+ appliance_overlay = make_qcow2_overlay (g, appliance, "raw");
|
||||||
|
+ if (!appliance_overlay)
|
||||||
|
+ goto cleanup;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
ITER_DRIVES (g, i, drv) {
|
||||||
|
if (make_qcow2_overlay_for_drive (g, drv) == -1)
|
||||||
|
@@ -393,7 +396,8 @@ launch_libvirt (guestfs_h *g, const char *libvirt_uri)
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
- guestfs___add_dummy_appliance_drive (g);
|
||||||
|
+ if (appliance)
|
||||||
|
+ guestfs___add_dummy_appliance_drive (g);
|
||||||
|
|
||||||
|
TRACE0 (launch_libvirt_end);
|
||||||
|
|
||||||
|
@@ -739,10 +743,12 @@ construct_libvirt_xml_devices (guestfs_h *g, xmlTextWriterPtr xo,
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
- /* Appliance disk. */
|
||||||
|
- if (construct_libvirt_xml_appliance (g, xo, appliance_overlay,
|
||||||
|
- appliance_index) == -1)
|
||||||
|
- goto err;
|
||||||
|
+ if (appliance_overlay) {
|
||||||
|
+ /* Appliance disk. */
|
||||||
|
+ if (construct_libvirt_xml_appliance (g, xo, appliance_overlay,
|
||||||
|
+ appliance_index) == -1)
|
||||||
|
+ goto err;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
/* Console. */
|
||||||
|
XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "serial"));
|
||||||
--
|
--
|
||||||
1.7.12.1
|
1.7.10.4
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user