Commit 7478150a authored by Daniel P. Berrange's avatar Daniel P. Berrange

Remove obsolete 'autodestroy' property

The 'autodestroy' property was added based on the flawed
assumption that all the stop/start logic could be kept
in the based sandbox context class. Now that the start
and stop methods are overridable in subclasses, the
property has no vale. Delete it.
Signed-off-by: 's avatarDaniel P. Berrange <berrange@redhat.com>
parent 3112df80
......@@ -50,7 +50,6 @@ struct _GVirSandboxContextPrivate
GVirConnection *connection;
GVirDomain *domain;
GVirSandboxConfig *config;
gboolean autodestroy;
};
G_DEFINE_ABSTRACT_TYPE(GVirSandboxContext, gvir_sandbox_context, G_TYPE_OBJECT);
......@@ -62,7 +61,6 @@ enum {
PROP_CONFIG,
PROP_DOMAIN,
PROP_CONNECTION,
PROP_AUTODESTROY,
};
enum {
......@@ -106,10 +104,6 @@ static void gvir_sandbox_context_get_property(GObject *object,
g_value_set_object(value, priv->connection);
break;
case PROP_AUTODESTROY:
g_value_set_boolean(value, priv->autodestroy);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
......@@ -143,10 +137,6 @@ static void gvir_sandbox_context_set_property(GObject *object,
priv->connection = g_value_dup_object(value);
break;
case PROP_AUTODESTROY:
priv->autodestroy = g_value_get_boolean(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
......@@ -219,28 +209,13 @@ static void gvir_sandbox_context_class_init(GVirSandboxContextClass *klass)
G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB));
g_object_class_install_property(object_class,
PROP_AUTODESTROY,
g_param_spec_boolean("autodestroy",
"Auto destroy",
"Automatically destroy sandbox on exit",
TRUE,
G_PARAM_READABLE |
G_PARAM_WRITABLE |
G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB));
g_type_class_add_private(klass, sizeof(GVirSandboxContextPrivate));
}
static void gvir_sandbox_context_init(GVirSandboxContext *ctxt)
{
GVirSandboxContextPrivate *priv;
priv = ctxt->priv = GVIR_SANDBOX_CONTEXT_GET_PRIVATE(ctxt);
priv->autodestroy = TRUE;
ctxt->priv = GVIR_SANDBOX_CONTEXT_GET_PRIVATE(ctxt);
}
......@@ -299,43 +274,6 @@ GVirConnection *gvir_sandbox_context_get_connection(GVirSandboxContext *ctxt)
}
/**
* gvir_sandbox_context_set_autodestroy:
* @ctxt: (transfer none): the sandbox context
* @state: the autodestroy flag state
*
* Control whether the sandbox should be automatically
* destroyed when the client which started it closes its
* connection to libvirtd. If @state is true, then the
* sandbox will be automatically destroyed upon client
* close/exit
*/
void gvir_sandbox_context_set_autodestroy(GVirSandboxContext *ctxt,
gboolean state)
{
GVirSandboxContextPrivate *priv = ctxt->priv;
priv->autodestroy = state;
}
/**
* gvir_sandbox_context_get_autodestroy:
* @ctxt: (transfer none): the sandbox context
*
* Determine whether the sandbox will be automatically
* destroyed when the client which started it closes its
* connection to libvirtd
*
* Returns: the autodestroy flag state
*/
gboolean gvir_sandbox_context_get_autodestroy(GVirSandboxContext *ctxt)
{
GVirSandboxContextPrivate *priv = ctxt->priv;
return priv->autodestroy;
}
static gboolean gvir_sandbox_context_start_default(GVirSandboxContext *ctxt, GError **error)
{
GVirSandboxContextPrivate *priv = ctxt->priv;
......
......@@ -68,10 +68,6 @@ GType gvir_sandbox_context_get_type(void);
GVirSandboxConfig *gvir_sandbox_context_get_config(GVirSandboxContext *ctxt);
void gvir_sandbox_context_set_autodestroy(GVirSandboxContext *ctxt,
gboolean state);
gboolean gvir_sandbox_context_get_autodestroy(GVirSandboxContext *ctxt);
gboolean gvir_sandbox_context_start(GVirSandboxContext *ctxt, GError **error);
gboolean gvir_sandbox_context_stop(GVirSandboxContext *ctxt, GError **error);
gboolean gvir_sandbox_context_attach(GVirSandboxContext *ctxt, GError **error);
......
......@@ -152,9 +152,7 @@ LIBVIRT_SANDBOX_0.2.1 {
gvir_sandbox_context_get_connection;
gvir_sandbox_context_get_log_console;
gvir_sandbox_context_get_shell_console;
gvir_sandbox_context_get_autodestroy;
gvir_sandbox_context_is_attached;
gvir_sandbox_context_set_autodestroy;
gvir_sandbox_context_start;
gvir_sandbox_context_stop;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment