[libvirt] Next release schedule and a snapshot
by Daniel Veillard
Hello everybody,
as suggested when we rolled out 0.9.13, I'm planning to make the
next release at the end of August. Since we added a driver we should
probably bump the medium number and shoot for 0.10.0. Also 2 months
without some official tarball to test was quite long so I made a
snapshot called 0.9.10-rc0, it's not a release candidate, just a
snapshot, development goes as usual. I tagged it into the git too
and it's available at
ftp://libvirt.org/libvirt/
So there is 3 more weeks of development before entering the 0.10.0
freeze,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
12 years, 3 months
[libvirt] [libvirt-glib 1/2] Add async variant of gvir_domain_resume()
by Zeeshan Ali (Khattak)
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
---
libvirt-gobject/libvirt-gobject-domain.c | 56 ++++++++++++++++++++++++++++++++
libvirt-gobject/libvirt-gobject-domain.h | 7 ++++
libvirt-gobject/libvirt-gobject.sym | 2 ++
3 files changed, 65 insertions(+)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
index 861f713..d6d804d 100644
--- a/libvirt-gobject/libvirt-gobject-domain.c
+++ b/libvirt-gobject/libvirt-gobject-domain.c
@@ -446,6 +446,62 @@ gboolean gvir_domain_resume(GVirDomain *dom,
return TRUE;
}
+static void
+gvir_domain_resume_helper(GSimpleAsyncResult *res,
+ GObject *object,
+ GCancellable *cancellable G_GNUC_UNUSED)
+{
+ GVirDomain *dom = GVIR_DOMAIN(object);
+ GError *err = NULL;
+
+ if (!gvir_domain_resume(dom, &err))
+ g_simple_async_result_take_error(res, err);
+}
+
+/**
+ * gvir_domain_resume_async:
+ * @dom: the domain
+ * @cancellable: (allow-none)(transfer none): cancellation object
+ * @callback: (scope async): completion callback
+ * @user_data: (closure): opaque data for callback
+ *
+ * Asynchronous variant of #gvir_domain_resume.
+ */
+void gvir_domain_resume_async(GVirDomain *dom,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *res;
+
+ g_return_if_fail(GVIR_IS_DOMAIN(dom));
+ g_return_if_fail((cancellable == NULL) || G_IS_CANCELLABLE(cancellable));
+
+ res = g_simple_async_result_new(G_OBJECT(dom),
+ callback,
+ user_data,
+ gvir_domain_resume_async);
+ g_simple_async_result_run_in_thread(res,
+ gvir_domain_resume_helper,
+ G_PRIORITY_DEFAULT,
+ cancellable);
+ g_object_unref(res);
+}
+
+gboolean gvir_domain_resume_finish(GVirDomain *dom,
+ GAsyncResult *result,
+ GError **err)
+{
+ g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE);
+ g_return_val_if_fail(g_simple_async_result_is_valid(result, G_OBJECT(dom), gvir_domain_resume_async), FALSE);
+ g_return_val_if_fail(err == NULL || *err == NULL, FALSE);
+
+ if (g_simple_async_result_propagate_error(G_SIMPLE_ASYNC_RESULT(result), err))
+ return FALSE;
+
+ return TRUE;
+}
+
/**
* gvir_domain_stop:
* @dom: the domain
diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h
index c61a2f5..6f74a97 100644
--- a/libvirt-gobject/libvirt-gobject-domain.h
+++ b/libvirt-gobject/libvirt-gobject-domain.h
@@ -162,6 +162,13 @@ gboolean gvir_domain_start_finish(GVirDomain *dom,
gboolean gvir_domain_resume(GVirDomain *dom,
GError **err);
+void gvir_domain_resume_async(GVirDomain *dom,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean gvir_domain_resume_finish(GVirDomain *dom,
+ GAsyncResult *result,
+ GError **err);
gboolean gvir_domain_stop(GVirDomain *dom,
guint flags,
GError **err);
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index fe3de97..926381d 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -177,6 +177,8 @@ LIBVIRT_GOBJECT_0.0.9 {
LIBVIRT_GOBJECT_0.1.1 {
global:
+ gvir_domain_resume_async;
+ gvir_domain_resume_finish;
gvir_domain_shutdown_flags_get_type;
gvir_domain_xml_flags_get_type;
} LIBVIRT_GOBJECT_0.0.9;
--
1.7.11.2
12 years, 3 months
[libvirt] [glib PATCH V5] Add bindings for virDomainRestore*()
by Jovanka Gulicoska
---
libvirt-gobject/libvirt-gobject-connection.c | 164 ++++++++++++++++++++++++++
libvirt-gobject/libvirt-gobject-connection.h | 20 ++++
libvirt-gobject/libvirt-gobject.sym | 4 +
3 files changed, 188 insertions(+)
diff --git a/libvirt-gobject/libvirt-gobject-connection.c b/libvirt-gobject/libvirt-gobject-connection.c
index 3a99034..dacac68 100644
--- a/libvirt-gobject/libvirt-gobject-connection.c
+++ b/libvirt-gobject/libvirt-gobject-connection.c
@@ -1605,3 +1605,167 @@ gvir_connection_get_capabilities_finish(GVirConnection *conn,
return g_object_ref(caps);
}
+
+/**
+ * gvir_connection_restore_domain_from_file:
+ * @conn: a #GVirConnection
+ * @filename: path to input file
+ * @custom_conf: (allow-none): configuration for domain or NULL
+ * @flags: the flags
+ *
+ * Returns: TRUE on success, FALSE otherwise
+ *
+ * Restores the domain saved with #gvir_domain_save_to_file
+ */
+gboolean gvir_connection_restore_domain_from_file(GVirConnection *conn,
+ gchar *filename,
+ GVirConfigDomain *custom_conf,
+ guint flags,
+ GError **err)
+{
+ GVirConnectionPrivate *priv;
+ int ret;
+
+ g_return_val_if_fail(GVIR_IS_CONNECTION(conn), FALSE);
+ g_return_val_if_fail((filename != NULL), FALSE);
+ g_return_val_if_fail((err == NULL) || (*err == NULL), FALSE);
+
+ priv = conn->priv;
+
+ if (flags || (custom_conf != NULL)) {
+ gchar *custom_xml = NULL;
+
+ if (custom_conf != NULL)
+ custom_xml = gvir_config_object_to_xml(GVIR_CONFIG_OBJECT(custom_conf));
+
+ ret = virDomainRestoreFlags(priv->conn, filename, custom_xml, flags);
+ g_free (custom_xml);
+ }
+ else {
+ ret = virDomainRestore(priv->conn, filename);
+ }
+
+ if (ret < 0) {
+ gvir_set_error_literal(err, GVIR_CONNECTION_ERROR,
+ 0,
+ "Unable to restore domain");
+
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+typedef struct {
+ gchar *filename;
+ GVirConfigDomain *custom_conf;
+ guint flags;
+} RestoreDomainFromFileData;
+
+static void restore_domain_from_file_data_free(RestoreDomainFromFileData *data)
+{
+ g_free(data->filename);
+ if (data->custom_conf != NULL)
+ g_object_unref(data->custom_conf);
+ g_slice_free(RestoreDomainFromFileData, data);
+}
+
+
+static void
+gvir_connection_restore_domain_from_file_helper
+ (GSimpleAsyncResult *res,
+ GObject *object,
+ GCancellable *cancellable G_GNUC_UNUSED)
+{
+ GVirConnection *conn = GVIR_CONNECTION(object);
+ RestoreDomainFromFileData *data;
+ GError *err = NULL;
+
+ data = g_simple_async_result_get_op_res_gpointer(res);
+
+ if (!gvir_connection_restore_domain_from_file(conn, data->filename,
+ data->custom_conf,
+ data->flags, &err))
+ g_simple_async_result_take_error(res, err);
+}
+
+/**
+ * gvir_connection_restore_domain_from_file_async:
+ * @conn: a #GVirConnection
+ * @filename: path to input file
+ * @custom_conf: (allow-none): configuration for domain
+ * @flags: the flags
+ * @cancellable: (allow-none) (transfer none): cancellation object
+ * @callback: (scope async): completion callback
+ * @user_data: (closure): opaque data for callback
+ *
+ * Asynchronous variant of #gvir_connection_restore_domain_from_file
+ */
+void
+gvir_connection_restore_domain_from_file_async(GVirConnection *conn,
+ gchar *filename,
+ GVirConfigDomain *custom_conf,
+ guint flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *res;
+ RestoreDomainFromFileData *data;
+
+ g_return_if_fail(GVIR_IS_CONNECTION(conn));
+ g_return_if_fail(filename != NULL);
+ g_return_if_fail((cancellable == NULL) || G_IS_CANCELLABLE(cancellable));
+
+ data = g_slice_new0(RestoreDomainFromFileData);
+ data->filename = g_strdup(filename);
+ if (custom_conf != NULL)
+ data->custom_conf = g_object_ref(custom_conf);
+ data->flags = flags;
+
+ res = g_simple_async_result_new
+ (G_OBJECT(conn),
+ callback,
+ user_data,
+ gvir_connection_restore_domain_from_file_async);
+ g_simple_async_result_set_op_res_gpointer
+ (res,
+ data,
+ (GDestroyNotify)restore_domain_from_file_data_free);
+
+ g_simple_async_result_run_in_thread
+ (res,
+ gvir_connection_restore_domain_from_file_helper,
+ G_PRIORITY_DEFAULT,
+ cancellable);
+
+ g_object_unref(res);
+}
+
+/**
+ * gvir_connection_restore_domain_from_file_finish:
+ * @conn: a #GVirConnection
+ * @result: (transfer none): async method result
+ * @err: Place-holder for possible errors
+ *
+ * Finishes the operation started by #gvir_restore_domain_from_file_async.
+ *
+ * Returns: TRUE if domain was restored successfully, FALSE otherwise.
+ */
+gboolean
+gvir_connection_restore_domain_from_file_finish(GVirConnection *conn,
+ GAsyncResult *result,
+ GError **err)
+{
+ g_return_val_if_fail(GVIR_IS_CONNECTION(conn), FALSE);
+ g_return_val_if_fail(g_simple_async_result_is_valid
+ (result, G_OBJECT(conn),
+ gvir_connection_restore_domain_from_file_async),
+ FALSE);
+
+ if (g_simple_async_result_propagate_error(G_SIMPLE_ASYNC_RESULT(result),
+ err))
+ return FALSE;
+
+ return TRUE;
+}
diff --git a/libvirt-gobject/libvirt-gobject-connection.h b/libvirt-gobject/libvirt-gobject-connection.h
index c80eecf..d658b01 100644
--- a/libvirt-gobject/libvirt-gobject-connection.h
+++ b/libvirt-gobject/libvirt-gobject-connection.h
@@ -202,6 +202,26 @@ gvir_connection_get_capabilities_finish(GVirConnection *conn,
GAsyncResult *result,
GError **err);
+gboolean
+gvir_connection_restore_domain_from_file(GVirConnection *conn,
+ gchar *filename,
+ GVirConfigDomain *custom_conf,
+ guint flags,
+ GError **err);
+
+void
+gvir_connection_restore_domain_from_file_async(GVirConnection *conn,
+ gchar *filename,
+ GVirConfigDomain *custom_conf,
+ guint flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean
+gvir_connection_restore_domain_from_file_finish(GVirConnection *conn,
+ GAsyncResult *result,
+ GError **err);
G_END_DECLS
#endif /* __LIBVIRT_GOBJECT_CONNECTION_H__ */
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index 54a093a..c31ed0f 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -169,6 +169,10 @@ LIBVIRT_GOBJECT_0.0.9 {
gvir_connection_get_capabilities_async;
gvir_connection_get_capabilities_finish;
+ gvir_connection_restore_domain_from_file;
+ gvir_connection_restore_domain_from_file_async;
+ gvir_conecction_restore_domain_from_file_finish;
+
gvir_domain_start_async;
gvir_domain_start_finish;
} LIBVIRT_GOBJECT_0.0.8;
--
1.7.10.4
12 years, 3 months
[libvirt] Generating our docs/search.php with xsltproc
by Martin Kletzander
Hi everyone.
TL;DR is there a way to keep PHP code untouched in XSL transformed XML?
For a while now, I'm trying to make our 'search.php' file generated like
all the '*.html' files (with all the fancy stuff like up-to-date menu,
headers and so on).
The problem I've been facing looks like an easy and doable thing /at
first/, but every normal approach I tried didn't work. I'm most probably
doing something wrong. I haven't used XSLT that much and this is very
badly google-able topic as lots of people are using XSL transformation
*inside* PHP and mangling the search results in their benefit.
I tried:
- using CDATA
- transforming the code with various elements
- turning off output escaping
- putting the code into another element
- various combinations of previous things
- and few others
Now it looks like the only option is to put the code part into another
file and inject it after the transformation, which is ugly, because it
means lots of modification (and unnecessary lines of code) for one file
(even though it would be applicable for all /possible/ future scripts).
I know this is not the best place to ask this question, but since we
have the web page generator using XSLT *and* it is for libvirt's
benefit, someone on the list might help me.
Thanks for any hints,
Martin
12 years, 3 months
[libvirt] [PATCHv3 0/3] Add usb controller model="none"
by Peter Krempa
This series adds support for completely disabling USB bus for a host if a user
requires this. For this to work a new USB controller model "none" was added
that removes the USB bus.
This series incorporates fixes for comments of Dan's and Eric's review and
is rebased on top of Dan's error handling cleanup.
Peter Krempa (3):
domain_conf: Add USB controler model "none"
domain_conf: Add helpers to verify if device configuration is valid
qemu: Add support for "none" USB controller
docs/formatdomain.html.in | 6 +-
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 107 +++++++++++++++++++-
src/conf/domain_conf.h | 4 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_command.c | 10 ++-
src/qemu/qemu_driver.c | 6 +
.../qemuxml2argvdata/qemuxml2argv-usb-none-hub.xml | 19 ++++
.../qemuxml2argv-usb-none-other.xml | 19 ++++
.../qemuxml2argv-usb-none-usbtablet.xml | 21 ++++
tests/qemuxml2argvdata/qemuxml2argv-usb-none.args | 5 +
tests/qemuxml2argvdata/qemuxml2argv-usb-none.xml | 16 +++
tests/qemuxml2argvtest.c | 10 ++
13 files changed, 221 insertions(+), 4 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-none-hub.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-none-other.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-none-usbtablet.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-none.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-none.xml
--
1.7.8.6
12 years, 3 months
[libvirt] [PATCH 00/49 v2] Atomic APIs to list objects
by Osier Yang
v1 - v2:
* Fix the stupid mistake - changing the public struct, error out
if the new option '--type' for pool-list is specified, and
the libvirt is old enough without listAllStoragePools supported.
Except the already supported APIs for domain and domain snapshot,
this series add the APIs for the left objects, including storage
pool, storage vol, network, interface, node device, nwfilter, and
secret.
* Storage pool:
- Support filtering the returned pool objects by active|inactive,
persistent|transient, autostart|no-autostart, and pool types.
- New options for virsh, --type to accept multiple pool types.
* Storage vol:
- Simply returns all the vol objects of a pool.
* Network:
- Support filtering the results using flags active|inactive,
persistent|transient, autostart|no-autostart
- New options for virsh.
* Interface:
- Support filtering the results using flags active|inactive.
It's still O(n) underlying, as interface driver doesn't manage
the objects itself, but using netcf lib instead. And netcf
APIs don't support returning the struct yet.
* Node Device:
- Support filtering the results using capabilities type of
the devices.
- Extend --cap to accept multiple capability type.
* Network Filter:
- Simply returns all the objects.
* Secret:
- Simply returns all the objects.
All the affected commands are tested with both new libvirt with the
APIs support, or old libvirt without the support. But I still may
lose some scenarios. Please review carefully.
Osier Yang (49):
Fix indentions
list: Rename virdomainlist.[ch] for common use
list: Define new API virStorageListALlStoragePools
list: Add helpers for listing storage pool objects
list: Implement the RPC calls for virConnectListAllStoragePools
list: Implement listAllStoragePools for storage driver
list: Implement listAllStoragePools for test driver
list: Add helper to convert strings separated by ',' to array
virsh: Fix the wrong doc for pool-list
list: Change MATCH for common use in virsh
list: Use virConnectListAllStoragePools in virsh
virsh: Use vshPrint instead of printf
python: Expose virStorageListAllStoragePools to python binding
list: Define new API virStoragePoolListAllVolumes
list: Implemente RPC calls for virStoragePoolListAllVolumes
list: Implement virStoragePoolListAllVolumes for storage driver
list: Implement virStoragePoolListAllVolumes for test driver
list: Use virStoragePoolListAllVolumes in virsh
list: Expose virStoragePoolListAllVolumes to Python binding
list: Define new API virConnectListAllNetworks
list: Implement RPC calls for virConnectListAllNetworks
list: Add helpers to list network objects
list: Implement listAllNetworks for network driver
list: Implement listAllNetworks for test driver
list: Use virConnectListAllNetworks in virsh
list: Expose virConnectListAllNetworks to Python binding
daemon: Fix the wrong macro name
list: Define new API virConnectListAllInterfaces
list: Implemente RPC calls for virConnectListAllInterfaces
list: Implement listAllInterfaces
list: Use virConnectListAllInterfaces in virsh
list: Expose virConnectListAllInterfaces to Python binding
list: Define new API virConnectListAllNodeDevices
list: Implemente RPC calls for virConnectListAllNodeDevices
list: Add helpers for listing node devices
list: Implement listAllNodeDevices
list: Expose virConnectListAllNodeDevices to Python binding
virsh: Fix a bug of nodedev-list
list: Use virConnectListAllNodeDevices in virsh
list: Define new API virConnectListAllNWFilters
list: Implement RPC calls for virConnectListAllNWFilters
list: Implement listAllNWFilters
list: Use virConnectListAllNWFilters in virsh
list: Expose virConnectListAllNWFilters to Python binding
list: Define new API virConnectListAllSecrets
list: Implement RPC calls for virConnectListAllSecrets
list: Implement listAllSecrets
list: Use virConnectListAllSecrets in virsh
list: Expose virConnectListAllSecrets to Python binding
daemon/libvirtd.c | 2 +-
daemon/remote.c | 382 +++++
include/libvirt/libvirt.h.in | 100 ++-
python/generator.py | 11 +-
python/libvirt-override-api.xml | 44 +-
python/libvirt-override-virConnect.py | 72 +
python/libvirt-override-virStoragePool.py | 11 +
python/libvirt-override.c | 337 +++++
src/Makefile.am | 8 +-
src/conf/domain_conf.c | 2 +-
src/conf/virdomainlist.c | 222 ---
src/conf/virdomainlist.h | 84 --
src/conf/virobjectlist.c | 535 +++++++
src/conf/virobjectlist.h | 162 +++
src/datatypes.h | 86 +-
src/driver.h | 35 +-
src/interface/netcf_driver.c | 135 ++
src/libvirt.c | 429 ++++++-
src/libvirt_private.syms | 6 +-
src/libvirt_public.syms | 11 +
src/libxl/libxl_driver.c | 4 +-
src/lxc/lxc_driver.c | 4 +-
src/network/bridge_driver.c | 18 +
src/node_device/node_device_driver.c | 16 +
src/node_device/node_device_driver.h | 3 +
src/node_device/node_device_hal.c | 1 +
src/node_device/node_device_udev.c | 1 +
src/nwfilter/nwfilter_driver.c | 57 +
src/openvz/openvz_driver.c | 4 +-
src/qemu/qemu_driver.c | 4 +-
src/remote/remote_driver.c | 449 ++++++
src/remote/remote_protocol.x | 78 +-
src/remote_protocol-structs | 85 ++
src/secret/secret_driver.c | 58 +-
src/storage/storage_driver.c | 86 ++
src/test/test_driver.c | 105 ++-
src/uml/uml_driver.c | 4 +-
src/vbox/vbox_tmpl.c | 10 +-
src/vmware/vmware_driver.c | 4 +-
tests/virdrivermoduletest.c | 2 +-
tools/virsh.c | 2171 ++++++++++++++++++++++-------
tools/virsh.pod | 51 +-
42 files changed, 4952 insertions(+), 937 deletions(-)
create mode 100644 python/libvirt-override-virStoragePool.py
delete mode 100644 src/conf/virdomainlist.c
delete mode 100644 src/conf/virdomainlist.h
create mode 100644 src/conf/virobjectlist.c
create mode 100644 src/conf/virobjectlist.h
Regards,
Osier
12 years, 3 months
[libvirt] [PATCH] fix error on loading libvirt_driver_qemu.so
by Hu Tao
When start up libvirtd, it gives error like this(wrapped):
2012-08-02 06:59:03.414+0000: 5463: error :
virDriverLoadModule:78 : failed to load module
/usr/lib64/libvirt/connection-driver/libvirt_driver_qemu.so
/usr/lib64/libvirt/connection-driver/libvirt_driver_qemu.so:
undefined symbol: virSecurityManagerGetProcessLabel
2012-08-02 06:59:03.415+0000: 5463: error :
virDriverLoadModule:78 : failed to load module
/usr/lib64/libvirt/connection-driver/libvirt_driver_lxc.so
/usr/lib64/libvirt/connection-driver/libvirt_driver_lxc.so:
undefined symbol: virSecurityManagerGetProcessLabel
This patch fixes the problem.
---
src/Makefile.am | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index b48ce65..c8f3e18 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -831,7 +831,8 @@ endif
if WITH_QEMU
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
-libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
+libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la \
+ libvirt_driver_security.la
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
--
1.7.10.2
12 years, 3 months
[libvirt] [PATCH v5] ESX: Add routines to interface driver
by Ata E Husain Bohra
Major changes includes:
a. Check for Memory allocation from strdup calls.
b. Removed ESX_VI__TEMPLATE__PROPERTY__DESERIALIZE_STRING_LIST workaround
c. Remove overwriting of error messages where it's not required.
Ata E Husain Bohra (1):
ESX: Add routines to interface driver
src/esx/esx_interface_driver.c | 551 +++++++++++++++++++++++++++++++++++++++-
src/esx/esx_vi.c | 125 +++++++++
src/esx/esx_vi.h | 10 +
src/esx/esx_vi_generator.input | 227 +++++++++++++++++
src/esx/esx_vi_generator.py | 23 ++
src/esx/esx_vi_types.c | 2 -
6 files changed, 934 insertions(+), 4 deletions(-)
--
1.7.9.5
12 years, 3 months
[libvirt] [PATCH v4] storage: netfs and iscsi need option srcSpec for resource discovery
by Guannan Ren
The option 'srcSpec' to virsh command find-storage-pool-sources
is optional for logical type of storage pool, but mandatory for
netfs and iscsi type.
When missing the option for netfs and iscsi, libvirt reports XML
parsing error due to null string option srcSpec.
before
error: Failed to find any netfs pool sources
error: (storage_source_specification):1: Document is empty
(null)
after:
error: pool type 'iscsi' requires option --srcSpec for source discovery
---
src/remote/remote_driver.c | 14 +-------------
src/storage/storage_backend_fs.c | 13 +++++++++----
src/storage/storage_backend_iscsi.c | 7 +++++++
tools/virsh-pool.c | 6 ++++++
4 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 9ac27b2..9354cb4 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -2648,23 +2648,11 @@ remoteFindStoragePoolSources (virConnectPtr conn,
remote_find_storage_pool_sources_args args;
remote_find_storage_pool_sources_ret ret;
struct private_data *priv = conn->storagePrivateData;
- const char *emptyString = "";
remoteDriverLock(priv);
args.type = (char*)type;
- /*
- * I'd think the following would work here:
- * args.srcSpec = (char**)&srcSpec;
- * since srcSpec is a remote_string (not a remote_nonnull_string).
- *
- * But when srcSpec is NULL, this yields:
- * libvir: Remote error : marshaling args
- *
- * So for now I'm working around this by turning NULL srcSpecs
- * into empty strings.
- */
- args.srcSpec = srcSpec ? (char **)&srcSpec : (char **)&emptyString;
+ args.srcSpec = srcSpec ? (char **)&srcSpec : NULL;
args.flags = flags;
memset (&ret, 0, sizeof(ret));
diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
index 01b517a..92a3228 100644
--- a/src/storage/storage_backend_fs.c
+++ b/src/storage/storage_backend_fs.c
@@ -258,10 +258,15 @@ virStorageBackendFileSystemNetFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSE
virCheckFlags(0, NULL);
- source = virStoragePoolDefParseSourceString(srcSpec,
- VIR_STORAGE_POOL_NETFS);
- if (!source)
- goto cleanup;
+ if (!srcSpec) {
+ virReportError(VIR_ERR_INVALID_ARG,
+ "%s", _("hostname must be specified for netfs sources"));
+ return NULL;
+ }
+
+ if (!(source = virStoragePoolDefParseSourceString(srcSpec,
+ VIR_STORAGE_POOL_NETFS)))
+ return NULL;
if (source->nhost != 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c
index b2f0c6c..75c2e52 100644
--- a/src/storage/storage_backend_iscsi.c
+++ b/src/storage/storage_backend_iscsi.c
@@ -582,6 +582,13 @@ virStorageBackendISCSIFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSED,
virCheckFlags(0, NULL);
+ if (!srcSpec) {
+ virReportError(VIR_ERR_INVALID_ARG,
+ "%s", _("hostname and device path "
+ "must be specified for iscsi sources"));
+ return NULL;
+ }
+
if (!(source = virStoragePoolDefParseSourceString(srcSpec,
list.type)))
return NULL;
diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c
index af80427..0f0b21e 100644
--- a/tools/virsh-pool.c
+++ b/tools/virsh-pool.c
@@ -1093,6 +1093,12 @@ cmdPoolDiscoverSources(vshControl * ctl, const vshCmd * cmd ATTRIBUTE_UNUSED)
if (srcSpecFile && virFileReadAll(srcSpecFile, VIRSH_MAX_XML_FILE, &srcSpec) < 0)
return false;
+ if (!srcSpec && (STREQ(type, "netfs") || STREQ(type, "iscsi"))) {
+ vshError(ctl, _("pool type '%s' requires option --srcSpec "
+ "for source discovery"), type);
+ return false;
+ }
+
srcList = virConnectFindStoragePoolSources(ctl->conn, type, srcSpec, 0);
VIR_FREE(srcSpec);
if (srcList == NULL) {
--
1.7.7.6
12 years, 3 months
[libvirt] [PATCH v4 0/3] ESX: Add routines to interface driver
by Ata E Husain Bohra
Updated the patch against review comments from Laine and Matthias.
Ata E Husain Bohra (3):
ESX: Add routines to interface driver
ESX: Add routines to interface driver
ESX: Add routines to interface driver
src/esx/esx_interface_driver.c | 499 +++++++++++++++++++++++++++++++++++++++-
src/esx/esx_vi.c | 126 ++++++++++
src/esx/esx_vi.h | 10 +
src/esx/esx_vi_generator.input | 227 ++++++++++++++++++
src/esx/esx_vi_generator.py | 31 ++-
src/esx/esx_vi_types.c | 18 +-
6 files changed, 906 insertions(+), 5 deletions(-)
--
1.7.9.5
12 years, 3 months