[PATCH 1/3] Add the s390 plugin

Vratislav Podzimek vpodzime at redhat.com
Wed May 20 11:19:26 UTC 2015


-------- Forwarded Message --------
From: Vratislav Podzimek <vpodzime at redhat.com>
To: anaconda patch review <anaconda-patches at lists.fedorahosted.org>
Subject: Re: [PATCH 1/3] Add the s390 plugin.
Date: Wed, 20 May 2015 11:50:57 +0200

Sending again as it seems that this email got dropped somewhere on the
way.


On Tue, 2015-05-19 at 22:30 -0400, Samantha N. Bueno wrote:
> diff --git a/src/lib/blockdev.c b/src/lib/blockdev.c
> index 44f987a..42bf67f 100644
> --- a/src/lib/blockdev.c
> +++ b/src/lib/blockdev.c
> @@ -19,6 +19,8 @@
>  #include "plugin_apis/dm.h"
>  #include "plugin_apis/mdraid.h"
>  #include "plugin_apis/mdraid.c"
> +#include "plugin_apis/s390.h"
> +#include "plugin_apis/s390.c"
>  
>  /**
>   * SECTION: blockdev
> @@ -41,7 +43,8 @@ static gchar * default_plugin_so[BD_PLUGIN_UNDEF] = 
> 
> {
>      "libbd_lvm.so."MAJOR_VER, "libbd_btrfs.so."MAJOR_VER,
>      "libbd_swap.so."MAJOR_VER, "libbd_loop.so."MAJOR_VER,
>      "libbd_crypto.so."MAJOR_VER, "libbd_mpath.so."MAJOR_VER,
> -    "libbd_dm.so."MAJOR_VER, "libbd_mdraid.so."MAJOR_VER
> +    "libbd_dm.so."MAJOR_VER, "libbd_mdraid.so."MAJOR_VER,
> +    "libbd_s390.so."MAJOR_VER
>  };
>  static BDPluginStatus plugins[BD_PLUGIN_UNDEF] = {
>      {{BD_PLUGIN_LVM, NULL}, NULL},
> @@ -51,10 +54,11 @@ static BDPluginStatus plugins[BD_PLUGIN_UNDEF] = 
> {
>      {{BD_PLUGIN_CRYPTO, NULL}, NULL},
>      {{BD_PLUGIN_MPATH, NULL}, NULL},
>      {{BD_PLUGIN_DM, NULL}, NULL},
> -    {{BD_PLUGIN_MDRAID, NULL}, NULL}
> +    {{BD_PLUGIN_MDRAID, NULL}, NULL},
> +    {{BD_PLUGIN_S390, NULL}, NULL}
>  };
>  static gchar* plugin_names[BD_PLUGIN_UNDEF] = {
> -    "lvm", "btrfs", "swap", "loop", "crypto", "mpath", "dm", 
> "mdraid"
> +    "lvm", "btrfs", "swap", "loop", "crypto", "mpath", "dm", 
> "mdraid", "s390"
>  };
>  
>  static void set_plugin_so_name (BDPlugin name, gchar *so_name) {
> @@ -93,6 +97,10 @@ static void unload_plugins () {
>      if (plugins[BD_PLUGIN_MDRAID].handle && !unload_mdraid 
> (plugins[BD_PLUGIN_MDRAID].handle))
>          g_warning ("Failed to close the mdraid plugin");
>      plugins[BD_PLUGIN_MDRAID].handle = NULL;
> +
> +    if (plugins[BD_PLUGIN_S390].handle && !unload_s390 
> (plugins[BD_PLUGIN_S390].handle))
> +        g_warning ("Failed to close the s390 plugin");
> +    plugins[BD_PLUGIN_S390].handle = NULL;
>  }
>  
>  static gboolean load_plugins (BDPluginSpec **require_plugins, 
> gboolean reload) {
> @@ -109,17 +117,36 @@ static gboolean load_plugins (BDPluginSpec 
> **require_plugins, gboolean reload) {
>      if (require_plugins) {
>          /* set requested so names or defaults if so names are not 
> specified */
>          for (i=0; *(require_plugins + i); i++) {
> -            if (require_plugins[i]->so_name)
> +            if (require_plugins[i]->so_name) {
> +                if (require_plugins[i]->so_name == BD_PLUGIN_S390) {
> +                    continue;
> +                }
I may have expressed my comment about this part in a wrong way, but
what I actually meant was that we should not only remove the #ifdef's,
but that we should remove this check completely here. If somebody
explicitly requests the s390 plugin, we should try to load it no matter
what. It's there business to deal with the failure. We should only skip
the s390 plugin implicitly if the default set is loaded
(require_plugins == NULL).

So just please drop this part of the change before pushing.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list