[Ovirt-devel] [PATCH node] Updated the configuration processing to remove the need for scripts.

Daniel P. Berrange berrange at redhat.com
Tue Oct 14 15:52:23 UTC 2008


On Tue, Oct 14, 2008 at 11:38:08AM -0400, Darryl L. Pierce wrote:
> The system now takes an encoded configuration descriptor from the server. It
> then parses from that a set of aliases for bondings if such exist. It then
> also extracts configuration details for the various network interfaces on the
> node. Afterward, it reloads module dependencies and then restarts the
> networking service.
> 
> Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
> ---
>  Makefile.am                  |    1 +
>  ovirt-node.spec.in           |    2 +
>  scripts/ovirt-early          |   14 +++-----
>  scripts/ovirt-process-config |   70 ++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 78 insertions(+), 9 deletions(-)
>  create mode 100755 scripts/ovirt-process-config
> 
> diff --git a/Makefile.am b/Makefile.am
> index 1d63310..c55db13 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -30,6 +30,7 @@ EXTRA_DIST =			\
>    scripts/ovirt-early		\
>    scripts/ovirt-functions	\
>    scripts/ovirt-post		\
> +  scripts/ovirt-process-config  \
>    logrotate/ovirt-logrotate	\
>    logrotate/ovirt-logrotate.conf
>  
> diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in
> index daa3d7f..ea8099d 100644
> --- a/ovirt-node.spec.in
> +++ b/ovirt-node.spec.in
> @@ -74,6 +74,7 @@ cd -
>  %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/logrotate.d
>  
>  %{__install} -p -m0755 scripts/ovirt-awake %{buildroot}%{_sbindir}
> +%{__install} -p -m0755 scripts/ovirt-process-config %{buildroot}%{_sbindir}
>  %{__install} -p -m0755 ovirt-identify-node/ovirt-identify-node %{buildroot}%{_sbindir}
>  %{__install} -p -m0755 ovirt-listen-awake/ovirt-listen-awake %{buildroot}%{_sbindir}
>  %{__install} -Dp -m0755 ovirt-listen-awake/ovirt-listen-awake.init %{buildroot}%{_initrddir}/ovirt-listen-awake
> @@ -145,6 +146,7 @@ fi
>  %files
>  %defattr(-,root,root,0755)
>  %{_sbindir}/ovirt-awake
> +%{_sbindir}/ovirt-process-config
>  %{_sbindir}/ovirt-identify-node
>  %{_sbindir}/ovirt-listen-awake
>  %{_sbindir}/ovirt-install-node
> diff --git a/scripts/ovirt-early b/scripts/ovirt-early
> index 4723426..3c8c494 100755
> --- a/scripts/ovirt-early
> +++ b/scripts/ovirt-early
> @@ -12,6 +12,8 @@
>  
>  # size of the oVirt partition in megabytes
>  OVIRT_SIZE=64
> +BONDING_MODCONF_FILE=/etc/modprobe.d/bonding

> +
> +modconf=$(awk '/bonding=/ {
> +        match($0, "^[ \t]*bonding=(.*)", data)
> +        split(data[1], mod, "|")
> +
> +        if (match("[^[:alnum:]=_ at -]", mod[1]) >= 0) {
> +            printf "invalid bonding alias: \"%s\"\n", mod[1];
> +            exit 1;
> +        }
> +
> +        alias=mod[1]
> +
> +        printf("install %s bonding", alias)
> +    }' $CONFIG)
> +
> +echo "$modconf" > $OVIRT_KERNEL_MODULE_FILE

There is no need to install the bonding module. THis is handled
automatically by the networking init scripts. You merely need
the aliases.

  # grep bonding /etc/modprobe.conf
  alias bond0 bonding
  alias bond1 bonding
  alias bond2 bonding


Danie
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the ovirt-devel mailing list