From 78fcab96fa2d689b5b278b594c5b6a028ca8738387f6132ee404f1c90b5d6ad9 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Mon, 8 Oct 2012 18:20:38 +0000 Subject: [PATCH] - make appliance optional when using libvirt as attach-method OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=126 --- 0001-launch-appliance-is-optional.patch | 41 +++++++++++++++++++++++++ libguestfs.changes | 5 +++ libguestfs.spec | 2 ++ 3 files changed, 48 insertions(+) create mode 100644 0001-launch-appliance-is-optional.patch diff --git a/0001-launch-appliance-is-optional.patch b/0001-launch-appliance-is-optional.patch new file mode 100644 index 0000000..c0f43d3 --- /dev/null +++ b/0001-launch-appliance-is-optional.patch @@ -0,0 +1,41 @@ +From 7abe52ae73d918b515098842b19cb54888729b72 Mon Sep 17 00:00:00 2001 +From: Olaf Hering +Date: Mon, 8 Oct 2012 19:51:38 +0200 +Subject: [PATCH] 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 +--- + src/launch-libvirt.c | 4 ++++ + 1 Datei geändert, 4 Zeilen hinzugefügt(+) + +diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c +index d678266..5914642 100644 +--- a/src/launch-libvirt.c ++++ b/src/launch-libvirt.c +@@ -936,6 +936,10 @@ construct_libvirt_xml_appliance (guestfs_h *g, xmlTextWriterPtr xo, + char drive_name[64] = "sd"; + char scsi_target[64]; + ++ /* appliance is optional */ ++ if (appliance == NULL) ++ return 0; ++ + guestfs___drive_name (drv_index, &drive_name[2]); + snprintf (scsi_target, sizeof scsi_target, "%zu", drv_index); + +-- +1.7.12.1 + diff --git a/libguestfs.changes b/libguestfs.changes index b8c817c..cd67e26 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Oct 8 20:17:39 CEST 2012 - ohering@suse.de + +- make appliance optional when using libvirt as attach-method + ------------------------------------------------------------------- Mon Oct 8 14:40:09 CEST 2012 - ohering@suse.de diff --git a/libguestfs.spec b/libguestfs.spec index 1f909b7..673c2fa 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -79,6 +79,7 @@ License: LGPL-2.1 Group: System/Filesystems Version: 1.19.48 Release: 0 +Patch0: 0001-launch-appliance-is-optional.patch Patch5: libguestfs-1.13.14-ruby.patch Patch1000: 1000-force-virtio_blk-in-old-guest-kernel.patch Source0: %{name}-%{version}.tar.gz @@ -353,6 +354,7 @@ virtual machines. %prep %setup -q +%patch0 -p1 %patch5 -p1 %patch1000 -p1