[Ovirt-devel] [PATCH appliance] Create cobbler system entries for fake nodes with custom kopts

Jim Meyering jim at meyering.net
Mon Sep 22 06:31:29 UTC 2008


Perry Myers <pmyers at redhat.com> wrote:
> node3 is created with ovirt_init=scsi causing the supplied 128MB
> disk to be used for config info
>
> node4 is created with ovirt_init=scsi and ovirt_local_boot
> installing the node itself on the local disk.  To fully test
> local boot the node configuration needs to be reset to boot
> hd instead of net.
>
> node5 is left alone for pxe boot with no local storage
>
> One liner to toggle boot type for a domain:
>
> OUT=$(mktemp) && virsh dumpxml node4 \
>   | sed "s/boot dev='.*'/boot dev='hd'/" > $OUT \
>   && virsh define $OUT ; rm -f $OUT

To be slightly safer, use '[^']*' in place of '.*'.
Then, if the XML is ever formatted so that there's another
single quote after the desired one, the substitution won't gobble
up everything in between.

Or just use perl's non-greedy "?" modifier:

  perl -pe "s/(boot dev)='.*?'/\$1='hd'/" > $OUT \

...
> diff --git a/ovirt-appliance.ks b/ovirt-appliance.ks
> index ebaaba2..7680c83 100644
> --- a/ovirt-appliance.ks
> +++ b/ovirt-appliance.ks
...

+1 for the better test coverage
ACK




More information about the ovirt-devel mailing list