From: "Daniel P. Berrange" <berrange@xxxxxxxxxx> --- libvirt-gobject/libvirt-gobject-connection.c | 6 ++-- libvirt-gobject/libvirt-gobject-connection.h | 4 +- libvirt-gobject/libvirt-gobject-domain-snapshot.c | 2 +- libvirt-gobject/libvirt-gobject-domain-snapshot.h | 2 +- libvirt-gobject/libvirt-gobject-domain.c | 37 ++++++++++++++------ libvirt-gobject/libvirt-gobject-domain.h | 16 ++++---- libvirt-gobject/libvirt-gobject-interface.c | 2 +- libvirt-gobject/libvirt-gobject-interface.h | 2 +- libvirt-gobject/libvirt-gobject-network-filter.c | 2 +- libvirt-gobject/libvirt-gobject-network-filter.h | 2 +- libvirt-gobject/libvirt-gobject-network.c | 2 +- libvirt-gobject/libvirt-gobject-network.h | 2 +- libvirt-gobject/libvirt-gobject-node-device.c | 2 +- libvirt-gobject/libvirt-gobject-node-device.h | 2 +- libvirt-gobject/libvirt-gobject-secret.c | 2 +- libvirt-gobject/libvirt-gobject-secret.h | 2 +- libvirt-gobject/libvirt-gobject-storage-pool.c | 12 +++--- libvirt-gobject/libvirt-gobject-storage-pool.h | 10 +++--- libvirt-gobject/libvirt-gobject-storage-vol.c | 2 +- libvirt-gobject/libvirt-gobject-storage-vol.h | 2 +- 20 files changed, 64 insertions(+), 49 deletions(-) diff --git a/libvirt-gobject/libvirt-gobject-connection.c b/libvirt-gobject/libvirt-gobject-connection.c index 6c8de11..f52b825 100644 --- a/libvirt-gobject/libvirt-gobject-connection.c +++ b/libvirt-gobject/libvirt-gobject-connection.c @@ -1145,7 +1145,7 @@ G_DEFINE_BOXED_TYPE(GVirConnectionHandle, gvir_connection_handle, * Return value: (transfer full): a #GVirStream stream, or NULL */ GVirStream *gvir_connection_get_stream(GVirConnection *self, - gint flags) + guint flags) { GVirConnectionClass *klass; @@ -1212,7 +1212,7 @@ GVirDomain *gvir_connection_create_domain(GVirConnection *conn, GVirStoragePool *gvir_connection_create_storage_pool (GVirConnection *conn, GVirConfigStoragePool *conf, - guint64 flags G_GNUC_UNUSED, + guint flags, GError **err) { const gchar *xml; virStoragePoolPtr handle; @@ -1222,7 +1222,7 @@ GVirStoragePool *gvir_connection_create_storage_pool g_return_val_if_fail(xml != NULL, NULL); - if (!(handle = virStoragePoolDefineXML(priv->conn, xml, 0))) { + if (!(handle = virStoragePoolDefineXML(priv->conn, xml, flags))) { *err = gvir_error_new_literal(GVIR_CONNECTION_ERROR, flags, "Failed to create storage pool"); diff --git a/libvirt-gobject/libvirt-gobject-connection.h b/libvirt-gobject/libvirt-gobject-connection.h index 9f4bdc3..92a15ab 100644 --- a/libvirt-gobject/libvirt-gobject-connection.h +++ b/libvirt-gobject/libvirt-gobject-connection.h @@ -163,12 +163,12 @@ GVirStoragePool *gvir_connection_find_storage_pool_by_name(GVirConnection *conn, GVirStoragePool *gvir_connection_create_storage_pool (GVirConnection *conn, GVirConfigStoragePool *conf, - guint64 flags, + guint flags, GError **err); GVirStream *gvir_connection_get_stream(GVirConnection *conn, - gint flags); + guint flags); G_END_DECLS diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.c b/libvirt-gobject/libvirt-gobject-domain-snapshot.c index 96be997..e536d72 100644 --- a/libvirt-gobject/libvirt-gobject-domain-snapshot.c +++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.c @@ -197,7 +197,7 @@ const gchar *gvir_domain_snapshot_get_name(GVirDomainSnapshot *snapshot) */ GVirConfigDomainSnapshot *gvir_domain_snapshot_get_config (GVirDomainSnapshot *snapshot, - guint64 flags, + guint flags, GError **err) { GVirDomainSnapshotPrivate *priv = snapshot->priv; diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.h b/libvirt-gobject/libvirt-gobject-domain-snapshot.h index 457c9dd..fc2eb7b 100644 --- a/libvirt-gobject/libvirt-gobject-domain-snapshot.h +++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.h @@ -66,7 +66,7 @@ const gchar *gvir_domain_snapshot_get_name(GVirDomainSnapshot *snapshot); GVirConfigDomainSnapshot *gvir_domain_snapshot_get_config (GVirDomainSnapshot *snapshot, - guint64 flags, + guint flags, GError **err); G_END_DECLS diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c index 7ff820b..4a7a534 100644 --- a/libvirt-gobject/libvirt-gobject-domain.c +++ b/libvirt-gobject/libvirt-gobject-domain.c @@ -301,12 +301,17 @@ gint gvir_domain_get_id(GVirDomain *dom, * @flags: the flags */ gboolean gvir_domain_start(GVirDomain *dom, - guint64 flags G_GNUC_UNUSED, + guint flags, GError **err) { GVirDomainPrivate *priv = dom->priv; + int ret; - if (virDomainCreate(priv->handle) < 0) { + if (flags) + ret = virDomainCreateWithFlags(priv->handle, flags); + else + ret = virDomainCreate(priv->handle); + if (ret < 0) { *err = gvir_error_new_literal(GVIR_DOMAIN_ERROR, 0, "Unable to start domain"); @@ -343,12 +348,17 @@ gboolean gvir_domain_resume(GVirDomain *dom, * @flags: the flags */ gboolean gvir_domain_stop(GVirDomain *dom, - guint64 flags G_GNUC_UNUSED, + guint flags, GError **err) { GVirDomainPrivate *priv = dom->priv; + int ret; - if (virDomainDestroy(priv->handle) < 0) { + if (flags) + ret = virDomainDestroyFlags(priv->handle, flags); + else + ret = virDomainDestroy(priv->handle); + if (ret < 0) { *err = gvir_error_new_literal(GVIR_DOMAIN_ERROR, 0, "Unable to stop domain"); @@ -364,12 +374,17 @@ gboolean gvir_domain_stop(GVirDomain *dom, * @flags: the flags */ gboolean gvir_domain_delete(GVirDomain *dom, - guint64 flags G_GNUC_UNUSED, + guint flags, GError **err) { GVirDomainPrivate *priv = dom->priv; + int ret; - if (virDomainUndefine(priv->handle) < 0) { + if (flags) + ret = virDomainUndefineFlags(priv->handle, flags); + else + ret = virDomainUndefine(priv->handle); + if (ret < 0) { *err = gvir_error_new_literal(GVIR_DOMAIN_ERROR, 0, "Unable to delete domain"); @@ -385,7 +400,7 @@ gboolean gvir_domain_delete(GVirDomain *dom, * @flags: the flags */ gboolean gvir_domain_shutdown(GVirDomain *dom, - guint64 flags G_GNUC_UNUSED, + guint flags G_GNUC_UNUSED, GError **err) { GVirDomainPrivate *priv = dom->priv; @@ -406,7 +421,7 @@ gboolean gvir_domain_shutdown(GVirDomain *dom, * @flags: the flags */ gboolean gvir_domain_reboot(GVirDomain *dom, - guint64 flags, + guint flags, GError **err) { GVirDomainPrivate *priv = dom->priv; @@ -428,7 +443,7 @@ gboolean gvir_domain_reboot(GVirDomain *dom, * Returns: (transfer full): the config */ GVirConfigDomain *gvir_domain_get_config(GVirDomain *dom, - guint64 flags, + guint flags, GError **err) { GVirDomainPrivate *priv = dom->priv; @@ -557,8 +572,8 @@ GVirDomainInfo *gvir_domain_get_info(GVirDomain *dom, */ gchar *gvir_domain_screenshot(GVirDomain *dom, GVirStream *stream, - guint64 monitor_id, - guint64 flags, + guint monitor_id, + guint flags, GError **err) { GVirDomainPrivate *priv; diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h index 0479de8..b67e8df 100644 --- a/libvirt-gobject/libvirt-gobject-domain.h +++ b/libvirt-gobject/libvirt-gobject-domain.h @@ -100,28 +100,28 @@ gint gvir_domain_get_id(GVirDomain *dom, GError **err); gboolean gvir_domain_start(GVirDomain *dom, - guint64 flags, + guint flags, GError **err); gboolean gvir_domain_resume(GVirDomain *dom, GError **err); gboolean gvir_domain_stop(GVirDomain *dom, - guint64 flags, + guint flags, GError **err); gboolean gvir_domain_delete(GVirDomain *dom, - guint64 flags, + guint flags, GError **err); gboolean gvir_domain_shutdown(GVirDomain *dom, - guint64 flags, + guint flags, GError **err); gboolean gvir_domain_reboot(GVirDomain *dom, - guint64 flags, + guint flags, GError **err); GVirDomainInfo *gvir_domain_get_info(GVirDomain *dom, GError **err); GVirConfigDomain *gvir_domain_get_config(GVirDomain *dom, - guint64 flags, + guint flags, GError **err); gboolean gvir_domain_set_config(GVirDomain *domain, GVirConfigDomain *conf, @@ -129,8 +129,8 @@ gboolean gvir_domain_set_config(GVirDomain *domain, gchar *gvir_domain_screenshot(GVirDomain *dom, GVirStream *stream, - guint64 monitor_id, - guint64 flags, + guint monitor_id, + guint flags, GError **err); G_END_DECLS diff --git a/libvirt-gobject/libvirt-gobject-interface.c b/libvirt-gobject/libvirt-gobject-interface.c index f74b47c..d35cdc2 100644 --- a/libvirt-gobject/libvirt-gobject-interface.c +++ b/libvirt-gobject/libvirt-gobject-interface.c @@ -186,7 +186,7 @@ const gchar *gvir_interface_get_name(GVirInterface *iface) * Returns: (transfer full): the config */ GVirConfigInterface *gvir_interface_get_config(GVirInterface *iface, - guint64 flags, + guint flags, GError **err) { GVirInterfacePrivate *priv = iface->priv; diff --git a/libvirt-gobject/libvirt-gobject-interface.h b/libvirt-gobject/libvirt-gobject-interface.h index 2fa76a8..c98dbc4 100644 --- a/libvirt-gobject/libvirt-gobject-interface.h +++ b/libvirt-gobject/libvirt-gobject-interface.h @@ -65,7 +65,7 @@ GType gvir_interface_handle_get_type(void); const gchar *gvir_interface_get_name(GVirInterface *iface); GVirConfigInterface *gvir_interface_get_config(GVirInterface *iface, - guint64 flags, + guint flags, GError **err); G_END_DECLS diff --git a/libvirt-gobject/libvirt-gobject-network-filter.c b/libvirt-gobject/libvirt-gobject-network-filter.c index b5ffbe7..6ce0f7c 100644 --- a/libvirt-gobject/libvirt-gobject-network-filter.c +++ b/libvirt-gobject/libvirt-gobject-network-filter.c @@ -212,7 +212,7 @@ const gchar *gvir_network_filter_get_uuid(GVirNetworkFilter *filter) */ GVirConfigNetworkFilter *gvir_network_filter_get_config (GVirNetworkFilter *filter, - guint64 flags, + guint flags, GError **err) { GVirNetworkFilterPrivate *priv = filter->priv; diff --git a/libvirt-gobject/libvirt-gobject-network-filter.h b/libvirt-gobject/libvirt-gobject-network-filter.h index f2c63cf..2c03c10 100644 --- a/libvirt-gobject/libvirt-gobject-network-filter.h +++ b/libvirt-gobject/libvirt-gobject-network-filter.h @@ -66,7 +66,7 @@ const gchar *gvir_network_filter_get_uuid(GVirNetworkFilter *filter); GVirConfigNetworkFilter *gvir_network_filter_get_config (GVirNetworkFilter *filter, - guint64 flags, + guint flags, GError **err); G_END_DECLS diff --git a/libvirt-gobject/libvirt-gobject-network.c b/libvirt-gobject/libvirt-gobject-network.c index 20b8012..237f788 100644 --- a/libvirt-gobject/libvirt-gobject-network.c +++ b/libvirt-gobject/libvirt-gobject-network.c @@ -208,7 +208,7 @@ const gchar *gvir_network_get_uuid(GVirNetwork *network) * Returns: (transfer full): the config */ GVirConfigNetwork *gvir_network_get_config(GVirNetwork *network, - guint64 flags, + guint flags, GError **err) { GVirNetworkPrivate *priv = network->priv; diff --git a/libvirt-gobject/libvirt-gobject-network.h b/libvirt-gobject/libvirt-gobject-network.h index 7b3d2dc..12ee917 100644 --- a/libvirt-gobject/libvirt-gobject-network.h +++ b/libvirt-gobject/libvirt-gobject-network.h @@ -69,7 +69,7 @@ const gchar *gvir_network_get_name(GVirNetwork *network); const gchar *gvir_network_get_uuid(GVirNetwork *network); GVirConfigNetwork *gvir_network_get_config(GVirNetwork *network, - guint64 flags, + guint flags, GError **err); G_END_DECLS diff --git a/libvirt-gobject/libvirt-gobject-node-device.c b/libvirt-gobject/libvirt-gobject-node-device.c index 784c594..162f930 100644 --- a/libvirt-gobject/libvirt-gobject-node-device.c +++ b/libvirt-gobject/libvirt-gobject-node-device.c @@ -187,7 +187,7 @@ const gchar *gvir_node_device_get_name(GVirNodeDevice *device) * Returns: (transfer full): the config */ GVirConfigNodeDevice *gvir_node_device_get_config(GVirNodeDevice *device, - guint64 flags, + guint flags, GError **err) { GVirNodeDevicePrivate *priv = device->priv; diff --git a/libvirt-gobject/libvirt-gobject-node-device.h b/libvirt-gobject/libvirt-gobject-node-device.h index 2b51b5d..250001b 100644 --- a/libvirt-gobject/libvirt-gobject-node-device.h +++ b/libvirt-gobject/libvirt-gobject-node-device.h @@ -64,7 +64,7 @@ GType gvir_node_device_handle_get_type(void); const gchar *gvir_node_device_get_name(GVirNodeDevice *device); GVirConfigNodeDevice *gvir_node_device_get_config(GVirNodeDevice *device, - guint64 flags, + guint flags, GError **err); G_END_DECLS diff --git a/libvirt-gobject/libvirt-gobject-secret.c b/libvirt-gobject/libvirt-gobject-secret.c index 0f885a1..5bde345 100644 --- a/libvirt-gobject/libvirt-gobject-secret.c +++ b/libvirt-gobject/libvirt-gobject-secret.c @@ -198,7 +198,7 @@ const gchar *gvir_secret_get_uuid(GVirSecret *secret) * Returns: (transfer full): the config */ GVirConfigSecret *gvir_secret_get_config(GVirSecret *secret, - guint64 flags, + guint flags, GError **err) { GVirSecretPrivate *priv = secret->priv; diff --git a/libvirt-gobject/libvirt-gobject-secret.h b/libvirt-gobject/libvirt-gobject-secret.h index 443ffde..e4d385e 100644 --- a/libvirt-gobject/libvirt-gobject-secret.h +++ b/libvirt-gobject/libvirt-gobject-secret.h @@ -66,7 +66,7 @@ const gchar *gvir_secret_get_name(GVirSecret *secret); const gchar *gvir_secret_get_uuid(GVirSecret *secret); GVirConfigSecret *gvir_secret_get_config(GVirSecret *secret, - guint64 flags, + guint flags, GError **err); G_END_DECLS diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.c b/libvirt-gobject/libvirt-gobject-storage-pool.c index ccc8e8a..915e0a1 100644 --- a/libvirt-gobject/libvirt-gobject-storage-pool.c +++ b/libvirt-gobject/libvirt-gobject-storage-pool.c @@ -223,7 +223,7 @@ const gchar *gvir_storage_pool_get_uuid(GVirStoragePool *pool) * Returns: (transfer full): the config */ GVirConfigStoragePool *gvir_storage_pool_get_config(GVirStoragePool *pool, - guint64 flags, + guint flags, GError **err) { GVirStoragePoolPrivate *priv = pool->priv; @@ -528,7 +528,7 @@ GVirStorageVol *gvir_storage_pool_create_volume * Return value: #True on success, #False otherwise. */ gboolean gvir_storage_pool_build (GVirStoragePool *pool, - guint64 flags, + guint flags, GError **err) { if (virStoragePoolBuild(pool->priv->handle, flags)) { @@ -542,7 +542,7 @@ gboolean gvir_storage_pool_build (GVirStoragePool *pool, } typedef struct { - guint64 flags; + guint flags; } StoragePoolBuildData; static void @@ -574,7 +574,7 @@ gvir_storage_pool_build_helper(GSimpleAsyncResult *res, * @user_data: (closure): opaque data for callback */ void gvir_storage_pool_build_async (GVirStoragePool *pool, - guint64 flags, + guint flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) @@ -632,7 +632,7 @@ gboolean gvir_storage_pool_build_finish(GVirStoragePool *pool, * Return value: #True on success, #False otherwise. */ gboolean gvir_storage_pool_start (GVirStoragePool *pool, - guint64 flags, + guint flags, GError **err) { if (virStoragePoolCreate(pool->priv->handle, flags)) { @@ -674,7 +674,7 @@ gvir_storage_pool_start_helper(GSimpleAsyncResult *res, * @user_data: (closure): opaque data for callback */ void gvir_storage_pool_start_async (GVirStoragePool *pool, - guint64 flags, + guint flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.h b/libvirt-gobject/libvirt-gobject-storage-pool.h index 25df1b1..d95bb19 100644 --- a/libvirt-gobject/libvirt-gobject-storage-pool.h +++ b/libvirt-gobject/libvirt-gobject-storage-pool.h @@ -66,7 +66,7 @@ const gchar *gvir_storage_pool_get_name(GVirStoragePool *pool); const gchar *gvir_storage_pool_get_uuid(GVirStoragePool *pool); GVirConfigStoragePool *gvir_storage_pool_get_config(GVirStoragePool *pool, - guint64 flags, + guint flags, GError **err); gboolean gvir_storage_pool_refresh(GVirStoragePool *pool, @@ -89,10 +89,10 @@ GVirStorageVol *gvir_storage_pool_create_volume GError **err); gboolean gvir_storage_pool_build (GVirStoragePool *pool, - guint64 flags, + guint flags, GError **err); void gvir_storage_pool_build_async (GVirStoragePool *pool, - guint64 flags, + guint flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); @@ -101,10 +101,10 @@ gboolean gvir_storage_pool_build_finish(GVirStoragePool *pool, GError **err); gboolean gvir_storage_pool_start (GVirStoragePool *pool, - guint64 flags, + guint flags, GError **err); void gvir_storage_pool_start_async (GVirStoragePool *pool, - guint64 flags, + guint flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); diff --git a/libvirt-gobject/libvirt-gobject-storage-vol.c b/libvirt-gobject/libvirt-gobject-storage-vol.c index ed48de8..a8aec60 100644 --- a/libvirt-gobject/libvirt-gobject-storage-vol.c +++ b/libvirt-gobject/libvirt-gobject-storage-vol.c @@ -198,7 +198,7 @@ const gchar *gvir_storage_vol_get_path(GVirStorageVol *vol) * Returns: (transfer full): the config */ GVirConfigStorageVol *gvir_storage_vol_get_config(GVirStorageVol *vol, - guint64 flags, + guint flags, GError **err) { GVirStorageVolPrivate *priv = vol->priv; diff --git a/libvirt-gobject/libvirt-gobject-storage-vol.h b/libvirt-gobject/libvirt-gobject-storage-vol.h index 3c6189b..8acdcf9 100644 --- a/libvirt-gobject/libvirt-gobject-storage-vol.h +++ b/libvirt-gobject/libvirt-gobject-storage-vol.h @@ -65,7 +65,7 @@ const gchar *gvir_storage_vol_get_name(GVirStorageVol *vol); const gchar *gvir_storage_vol_get_path(GVirStorageVol *vol); GVirConfigStorageVol *gvir_storage_vol_get_config(GVirStorageVol *vol, - guint64 flags, + guint flags, GError **err); G_END_DECLS -- 1.7.6.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list