summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2012-10-08 20:10:36 +0200
committerRichard W.M. Jones <rjones@redhat.com>2012-10-09 09:45:42 +0100
commit45c9fbd6f50eeed9307892e883b25b8b3b263b3a (patch)
treea54118ea5b67514c2fc6c4130f626844513795c6 /src
parent0a85fbc946d7838366c35c0425efddb1a91f593c (diff)
downloadlibguestfs-45c9fbd6f50eeed9307892e883b25b8b3b263b3a.tar.gz
libguestfs-45c9fbd6f50eeed9307892e883b25b8b3b263b3a.tar.xz
libguestfs-45c9fbd6f50eeed9307892e883b25b8b3b263b3a.zip
launch: appliance is optional
# virt-filesystems -v -d 6326ad4e-5805-2ab4-1338-d1dad8c76162 --all libguestfs: libvirt version = 10002 libguestfs: [00000ms] connect to libvirt libguestfs: [00001ms] get libvirt capabilities libguestfs: [00234ms] build appliance libguestfs: [00234ms] create libvirt XML libguestfs: error: error constructing libvirt XML at "xmlTextWriterWriteAttribute (xo, BAD_CAST "file", BAD_CAST appliance)": No such file or directory libguestfs: closing guestfs handle 0x656270 (state 0) # ls -lh /usr/lib64/guestfs/* -rw-r--r-- 1 root root 13M Oct 8 16:15 /usr/lib64/guestfs/initramfs.x86_64.img -rw-r--r-- 1 root root 3.7M Oct 6 09:25 /usr/lib64/guestfs/vmlinuz.x86_64 Signed-off-by: Olaf Hering <olaf@aepfle.de>
Diffstat (limited to 'src')
-rw-r--r--src/launch-libvirt.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
index 5b7897d7..183008ed 100644
--- a/src/launch-libvirt.c
+++ b/src/launch-libvirt.c
@@ -194,10 +194,13 @@ launch_libvirt (guestfs_h *g, const char *libvirt_uri)
/* Create overlays for read-only drives and the appliance. This
* works around lack of support for <transient/> disks in libvirt.
+ * Note that appliance can be NULL if using the old-style appliance.
*/
- appliance_overlay = make_qcow2_overlay (g, appliance, "raw");
- 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"));