[PATCH] run: Don't fail on missing LIBGUESTFS_PATH if --disable-appliance
by Hilko Bengen
Set LIBGUESTFS_PATH to the default value compiled into and output a
warning to STDERR, instead.
The previous behavior caused the build to abort when trying to build
the sysprep documentation -- without much of a hint of what went
wrong.
When LIBGUESTFS_PATH was not set, test-events.sh would fail.
---
run.in | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/run.in b/run.in
index 7545f0b..5adaa3a 100755
--- a/run.in
+++ b/run.in
@@ -66,9 +66,11 @@ chcon --reference=/tmp tmp 2>/dev/null ||:
if [ "x@ENABLE_APPLIANCE@" = "xyes" ]; then
export LIBGUESTFS_PATH="$b/appliance"
elif [ -z "$LIBGUESTFS_PATH" ]; then
- echo "run: error: You used './configure --disable-appliance' so you must put an"
- echo "run: error: appliance somewhere and set LIBGUESTFS_PATH to point to it."
- exit 1
+ cat <<'EOF' >&2
+run: warning: LIBGUESTFS_PATH is not set. Setting it to @libdir@/guestfs
+EOF
+ LIBGUESTFS_PATH=@libdir@/guestfs
+ export LIBGUESTFS_PATH
fi
if [ -z "$LD_LIBRARY_PATH" ]; then
--
1.7.10.4
11 years, 5 months
[PATCH 0/1] guestfish: Tab-complete single / double quoted filenames containing space - introduce list_directory_entries() routine
by Jan Lieskovsky
This series provides support for tab completion also for single / double
quoted filenames, which can contain space.
Patch 0/1 - separates guestfs list directory content functionality
(from complete_dest_paths_generator()) into dedicated
list_directory_entries() routine, so it can be subsequently
re-used in other code places.
Patch 1/1 - introduces fish_completion_word_break_characters_hook for
guestfish (depends on list_directory_entries()).
Thank you && Regards, Jan.
--
Jan iankko Lieskovsky
P.S.: Feel free to remove the comment lines, if you find them unnecessary.
11 years, 5 months
[PATCH] run: Turn error message about missing LIBGUESTFS_PATH into warning; output to STDERR
by Hilko Bengen
The previous behavior caused the build to abort when trying to build
the sysprep documentation -- without much of a hint of what went
wrong.
---
run.in | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/run.in b/run.in
index 7545f0b..9f92306 100755
--- a/run.in
+++ b/run.in
@@ -66,9 +66,10 @@ chcon --reference=/tmp tmp 2>/dev/null ||:
if [ "x@ENABLE_APPLIANCE@" = "xyes" ]; then
export LIBGUESTFS_PATH="$b/appliance"
elif [ -z "$LIBGUESTFS_PATH" ]; then
- echo "run: error: You used './configure --disable-appliance' so you must put an"
- echo "run: error: appliance somewhere and set LIBGUESTFS_PATH to point to it."
- exit 1
+ cat <<'EOF' >&2
+run: warning: You used './configure --disable-appliance' so LIBGUESTFS_PATH
+run: warning: has not been set oautomatically.
+EOF
fi
if [ -z "$LD_LIBRARY_PATH" ]; then
--
1.7.10.4
11 years, 5 months
guestfish runs w/ a nested guest
by Kashyap Chamarthy
# Ref: http://libguestfs.org/guestfs-performance.1.html
Run the below command:
$ time guestfish -a /dev/null run
NOTE: Discard the first few results, to get a hot cache. (Thanks Rich.)
1/ L0. with L1 running.
----------------------------------------------------------------------
$ for i in {1..10}; do time guestfish -a /dev/null run; done
real 0m28.277s
user 0m11.028s
sys 0m0.706s
real 0m2.753s
user 0m0.054s
sys 0m0.049s
real 0m2.771s
user 0m0.063s
sys 0m0.044s
real 0m2.774s
user 0m0.053s
sys 0m0.044s
real 0m2.772s
user 0m0.054s
sys 0m0.049s
real 0m2.715s
user 0m0.051s
sys 0m0.045s
real 0m2.753s
user 0m0.064s
sys 0m0.037s
real 0m2.709s
user 0m0.059s
sys 0m0.044s
real 0m2.782s
user 0m0.055s
sys 0m0.045s
real 0m2.775s
user 0m0.054s
sys 0m0.049s
----------------------------------------------------------------------
=> Remove the appliance and re-run:
----------------------------------------------------------------------
$ rm -rf /var/tmp/guestfs-0
$ for in in {1..2}; do time guestfish -a /dev/null run; done
real 0m14.623s
user 0m10.172s
sys 0m0.520s
real 0m2.790s
user 0m0.048s
sys 0m0.046s
----------------------------------------------------------------------
2. L1 w/ nesting, VMCS shadowing enabled. NOTE: *NO* L2 guests are running
while this test is being performed.
----------------------------------------------------------------------
$ for i in {1..10}; do time guestfish -a /dev/null run; done | tee
guestfish-timings-L1.txt
real 0m55.182s
user 0m14.747s
sys 0m8.501s
real 0m8.754s
user 0m0.054s
sys 0m0.494s
real 0m9.576s
user 0m0.056s
sys 0m0.490s
real 0m8.793s
user 0m0.056s
sys 0m0.498s
real 0m8.767s
user 0m0.053s
sys 0m0.492s
real 0m8.715s
user 0m0.049s
sys 0m0.502s
real 0m8.814s
user 0m0.051s
sys 0m0.503s
real 0m8.765s
user 0m0.046s
sys 0m0.516s
real 0m8.783s
user 0m0.050s
sys 0m0.502s
real 0m8.739s
user 0m0.054s
sys 0m0.496s
----------------------------------------------------------------------
=> Next, is to try: L1 w/o nesting, VMCS shadowing disabled.
----------------------------------------------------------------------
# On L0
$ vi /etc/modprobe.d/dist.conf
- s/options kvm-intel nested=y/options kvm-intel nested=n/
# For the test purpose, remove the XML fragment (which adds VMX
# extensions) for L1 CPU
$ virsh edit regular-guest
- Remove the below fragment, save it:
<cpu mode='custom' match='exact'>
<model fallback='allow'>Haswell</model>
<feature policy='require' name='vmx'/>
</cpu>
# Reboot
$ init 6
# Check for the nested parameter on L0
$ cat /sys/module/kvm_intel/parameters/nested
N
# Remove any old appliances
$ rm -rf /var/tmp/.guestfs-0
# Run:
$ for i in {1..10}; do time guestfish -a /dev/null run; done | tee \
guestfish-timings-L1-no-nested.txt
----------------------------------------------------------------------
--
/kashyap
11 years, 5 months
support remotely mounting disk images in p2v
by Mo Morsi
Figure I'd share the latest revision to p2v I had regarding $subject.
The patch now applies against HEAD and compiles fine. I was able to update
the package on the client and run virt-p2v, though have yet to do a full
end-to-end verification
Most likely a little more work is needed to tidy up some edge cases and fully
flush things out, but the majority of the work should be in place.
On the client side the disk is exported using qemu-nbd and an new ssh forwarding
channel is opened up infront of it. The server simply instructs libguestfs to connect
to nbd://localhost:port/ and the rest is taken care of.
11 years, 5 months
[PATCH] Fix compiler warning when libselinux is not present
by Matthew Booth
static function selinux_warning() isn't used if HAVE_LIBSELINUX isn't
defined, which results in a warning.
---
src/launch-libvirt.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
index 4588602..10a4d2c 100644
--- a/src/launch-libvirt.c
+++ b/src/launch-libvirt.c
@@ -138,7 +138,10 @@ static int make_drive_priv (guestfs_h *g, struct drive *drv, const char *selinux
static void drive_free_priv (void *);
static void set_socket_create_context (guestfs_h *g);
static void clear_socket_create_context (guestfs_h *g);
+
+#if HAVE_LIBSELINUX
static void selinux_warning (guestfs_h *g, const char *func, const char *selinux_op, const char *data);
+#endif
static int
launch_libvirt (guestfs_h *g, const char *libvirt_uri)
@@ -1716,6 +1719,7 @@ libvirt_error (guestfs_h *g, const char *fs, ...)
free (msg);
}
+#if HAVE_LIBSELINUX
static void
selinux_warning (guestfs_h *g, const char *func,
const char *selinux_op, const char *data)
@@ -1724,6 +1728,7 @@ selinux_warning (guestfs_h *g, const char *func,
" [you can ignore this UNLESS using SELinux + sVirt]",
func, selinux_op, data ? data : "(none)");
}
+#endif
/* This backend assumes virtio-scsi is available. */
static int
--
1.8.1.4
11 years, 5 months
Re: [Libguestfs] [PATCH 0/5] rbd improvements
by Richard W.M. Jones
On Thu, May 09, 2013 at 11:23:55AM -0400, Mike Kelly wrote:
> On Wed, May 8, 2013 at 6:53 AM, Richard W.M. Jones <rjones(a)redhat.com> wrote:
> > One worry I have is whether quoting is required for the server
> > name(s), export name, username and secret.
>
> Well. I think the main things we had to quote were ':' and ';', but
> none of those are valid in a hostname. Username also probably doesn't
> contain anything special, and secret is a base64-encoded string. I
> confirmed that even with the string ending in '==', it was parsed just
> fine by qemu, at least in my limited manual testing.
>
> If you can suggest a way to be more robust this, though, then I can
> try to work that into a future patch series.
The quoting problem happens when someone writes a program which takes
(eg) a hostname string from the user and passes it unmodified to the
guestfs API. It's an issue if this string can cause unexpected [even
malicious/exploitable] things to happen when passed unquoted on the
qemu command line.
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 KVM guests.
http://libguestfs.org/virt-v2v
11 years, 5 months
remotely mounting client disks in p2v server
by Mo Morsi
Just spent a little time poking around w/ p2v and am attaching the
following pseudo-code for consideration. Note the patches aren't commit
ready yet, just looking for thoughts
- The first is a fix to get client image building process working on F17.
It seems the version of ksflatten there didn't expand the nested %includes
which was causing errors (also --interpreter image-minimizer resulted in errors)
- The next patch adds an option to the ui to allow the user to specify that
they would like to mount a disk as opposed to copy it to the server. This
option is currently mutually exclusive w/ the 'convert' checkbox.
An option still needs to be added to the ui to toggle how to export the
local disks (nbd, iscsi, etc). Would adding this as a global flag (eg applies
to all disks) work?
- The next patch stubs out some code which to process the disks for which 'mount'
was select. The actual calls to export the nbd/iscsi disk have yet to be added
though the mount command is issued to the server.
- The final patch stubs out the corresponding server side functionality which interprets
the mount command and includes placeholders to connect to the remote uri locally
and pass the remote disks onto the converter.
The commands to setup the nbd/iscsi server and client (on the p2v client and server respectively)
are simple enough though I still have to look into how to use the existing ssh tunnel
for security.
Does this looks to be in about the right direction? Other thoughts?
-Mo
11 years, 5 months