X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fguestfs.pod;h=f0fdf89093b1169aa6e312e140c9a149ed62e07a;hb=3f54bd02fcf540f9b4b6edc93f3b6b9c7ba136bd;hp=5eb17f223c4ee65c409bbfa59609d37424e24aac;hpb=1018e225ddee3d87564ed52579994867493d187a;p=libguestfs.git diff --git a/src/guestfs.pod b/src/guestfs.pod index 5eb17f2..f0fdf89 100644 --- a/src/guestfs.pod +++ b/src/guestfs.pod @@ -948,6 +948,29 @@ For example: Note that libguestfs also calls qemu with the -help and -version options in order to determine features. +Wrappers can also be used to edit the options passed to qemu. In the +following example, the C<-machine ...> option (C<-machine> and the +following argument) are removed from the command line and replaced +with C<-machine pc,accel=tcg>. The while loop iterates over the +options until it finds the right one to remove, putting the remaining +options into the C array. + + #!/bin/bash - + + i=0 + while [ $# -gt 0 ]; do + case "$1" in + -machine) + shift 2;; + *) + args[i]="$1" + (( i++ )) + shift ;; + esac + done + + exec qemu-kvm -machine pc,accel=tcg "${args[@]}" + =head2 ATTACHING TO RUNNING DAEMONS I This is B and has a tendency to eat @@ -2867,13 +2890,17 @@ Regression tests. L command and documentation. +=item C + +L command and documentation. + =item C Source code to the C library. =item C -Command line tools written in Perl (L and many others). +Command line tools written in Perl (L and many others). =item C @@ -3138,6 +3165,7 @@ L, L, L, L, +L, L, L, L,