X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fguestfs.pod;h=2005ac10b37483e5d68d122f656e542d445cc978;hb=440b2a006506ac3b194bed9ce64a0cecebb06778;hp=5eb17f223c4ee65c409bbfa59609d37424e24aac;hpb=1018e225ddee3d87564ed52579994867493d187a;p=libguestfs.git diff --git a/src/guestfs.pod b/src/guestfs.pod index 5eb17f2..2005ac1 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 @@ -2873,7 +2896,7 @@ 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