[PATCH][RFC] 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> --- perhaps the if (!appliance) check should be somewhere else? src/launch-libvirt.c | 4 ++++ 1 file changed, 4 insertions(+) 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
On Mon, Oct 08, 2012 at 08:10:36PM +0200, Olaf Hering wrote:
# 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> ---
perhaps the if (!appliance) check should be somewhere else?
src/launch-libvirt.c | 4 ++++ 1 file changed, 4 insertions(+)
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
I'd forgotten that anyone was using the old-style appliance. The patch is fine and I'll apply it, possibly modified. But out of interest, how are you creating this appliance? I thought we'd ripped out support for old-style appliances from the rest of the toolchain ... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
On Mon, Oct 08, Richard W.M. Jones wrote:
But out of interest, how are you creating this appliance? I thought we'd ripped out support for old-style appliances from the rest of the toolchain ...
I use mkinitrd to pull in all tools and run guestfsd instead of /sysroot/sbin/init. This allows me to build the package automated as unprivileged user in the buildsystem. Creating a loop file requires root, which is cumbersome in the openSuSE buildservice. In src/appliance I noticed that initramfs.<arch>.img etc. is obsolete, will it be removed for 1.20? Olaf
On Mon, Oct 08, 2012 at 08:50:47PM +0200, Olaf Hering wrote:
On Mon, Oct 08, Richard W.M. Jones wrote:
But out of interest, how are you creating this appliance? I thought we'd ripped out support for old-style appliances from the rest of the toolchain ...
I use mkinitrd to pull in all tools and run guestfsd instead of /sysroot/sbin/init. This allows me to build the package automated as unprivileged user in the buildsystem. Creating a loop file requires root, which is cumbersome in the openSuSE buildservice.
In src/appliance I noticed that initramfs.<arch>.img etc. is obsolete, will it be removed for 1.20?
No we shouldn't remove this, I guess I'll have to make this work. There are quite a lot of assumptions in the libvirt backend that appliance != NULL, but we can fix them ... On a cursory look, the ordinary (appliance) backend handles appliance == NULL fine. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
On Mon, Oct 08, 2012 at 07:54:08PM +0100, Richard W.M. Jones wrote:
On Mon, Oct 08, 2012 at 08:50:47PM +0200, Olaf Hering wrote:
On Mon, Oct 08, Richard W.M. Jones wrote:
But out of interest, how are you creating this appliance? I thought we'd ripped out support for old-style appliances from the rest of the toolchain ...
I use mkinitrd to pull in all tools and run guestfsd instead of /sysroot/sbin/init. This allows me to build the package automated as unprivileged user in the buildsystem. Creating a loop file requires root, which is cumbersome in the openSuSE buildservice.
In src/appliance I noticed that initramfs.<arch>.img etc. is obsolete, will it be removed for 1.20?
No we shouldn't remove this, I guess I'll have to make this work.
There are quite a lot of assumptions in the libvirt backend that appliance != NULL, but we can fix them ...
The attached patch isn't tested, but it seems as if it should work. I've based it on top of my current set of hotplugging patches because this code has changed so much. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
On Mon, Oct 08, 2012 at 08:50:47PM +0200, Olaf Hering wrote:
On Mon, Oct 08, Richard W.M. Jones wrote:
But out of interest, how are you creating this appliance? I thought we'd ripped out support for old-style appliances from the rest of the toolchain ...
I use mkinitrd to pull in all tools and run guestfsd instead of /sysroot/sbin/init. This allows me to build the package automated as unprivileged user in the buildsystem. Creating a loop file requires root, which is cumbersome in the openSuSE buildservice.
BTW, febootstrap (which is what we use) runs unprivileged and should be able to process SuSE rpms. However it does require yum, not zypper, but that's probably easy to fix if zypper has a way to take a list of package names and resolve all the dependencies without needing root and without needing to install any packages. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
On Mon, Oct 08, Richard W.M. Jones wrote:
BTW, febootstrap (which is what we use) runs unprivileged and should be able to process SuSE rpms. However it does require yum, not zypper, but that's probably easy to fix if zypper has a way to take a list of package names and resolve all the dependencies without needing root and without needing to install any packages.
I think it can do that, but so far I havent looked at this part. Olaf
participants (2)
-
Olaf Hering -
Richard W.M. Jones