[libvirt] [PATCH 0/8 v4] Summary on block IO throttle
by Lei Li
Changes since V3
- Use virTypedParameterPtr instead of specific struct in libvirt pulic API.
- Relevant changes to remote driver, qemu driver, python support and virsh.
Changes since V2
- Implement the Python binding support for setting blkio throttling.
- Implement --current --live --config options support to unify the libvirt API.
- Add changes in docs and tests.
- Some changes suggested by Adam Litke, Eric Blake, Daniel P. Berrange.
- Change the XML schema.
- API name to virDomain{Set, Get}BlockIoTune.
- Parameters changed to make them more self-explanatory.
- virsh command name to blkdeviotune.
- And other fixups.
Changes since V1
- Implement the support to get the block io throttling for
a device as read only connection - QMP/HMP.
- Split virDomainBlockIoThrottle into two separate functions
virDomainSetBlockIoThrottle - Set block I/O limits for a device
- Requires a connection in 'write' mode.
- Limits (info) structure passed as an input parameter
virDomainGetBlockIoThrottle - Get the current block I/O limits for a device
- Works on a read-only connection.
- Current limits are written to the output parameter (reply).
- And Other fixups suggested by Adam Litke, Daniel P. Berrange.
- For dynamically allocate the blkiothrottle struct, I will fix
it when implement --current --live --config options support.
Today libvirt supports the cgroups blkio-controller, which handles
proportional shares and throughput/iops limits on host block devices.
blkio-controller does not support network file systems (NFS) or other
QEMU remote block drivers (curl, Ceph/rbd, sheepdog) since they are
not host block devices. QEMU I/O throttling works with all types of
drive and can be applied independently to each drive attached to
a guest and supports throughput/iops limits.
To help add QEMU I/O throttling support to libvirt, we plan to complete
it with add new API virDomain{Set, Get}BlockIoThrottle(), new command 'blkdeviotune'
and Python bindings.
Notes: Now all the planed features were implemented (#1#2 were implemented by
Zhi Yong Wu), the previous comments were all fixed up too. And the qemu part patches
have been accepted upstream and are expected to be part of the QEMU 1.1
release, git tree from Zhi Yong:
http://repo.or.cz/w/qemu/kevin.git/shortlog/refs/heads/block
1) Enable the blkio throttling in xml when guest is starting up.
Add blkio throttling in xml as follows:
<disk type='file' device='disk'>
...
<iotune>
<total_bytes_sec>nnn</total_bytes_sec>
...
</iotune>
...
</disk>
2) Enable blkio throttling setting at guest running time.
virsh blkdeviotune <domain> <device> [--total_bytes_sec<number>] [--read_bytes_sec<number>] \
[--write_bytes_sec<number>] [--total_iops_sec<number>] [--read_iops_sec<number>]
[--write_iops_sec<number>]
3) The support to get the current block i/o throttling for a device - HMP/QMP.
virsh blkiothrottle <domain> <device>
total_bytes_sec:
read_bytes_sec:
write_bytes_sec:
total_iops_sec:
read_iops_sec:
write_iops_sec:
4) Python binding support for setting blkio throttling.
5) --current --live --config options support to unify the libvirt API.
virsh blkdeviotune <domain> <device> [--total_bytes_sec <number>] [--read_bytes_sec <number>]
[--write_bytes_sec <number>] [--total_iops_sec <number>] [--read_iops_sec <number>]
[--write_iops_sec <number>] [--config] [--live] [--current]
daemon/remote.c | 108 +++++++
docs/formatdomain.html.in | 31 ++
docs/schemas/domaincommon.rng | 24 ++
include/libvirt/libvirt.h.in | 70 ++++
python/generator.py | 2 +
python/libvirt-override-api.xml | 16 +
python/libvirt-override.c | 179 +++++++++++
src/conf/domain_conf.c | 101 ++++++-
src/conf/domain_conf.h | 12 +
src/driver.h | 20 ++
src/libvirt.c | 145 +++++++++
src/libvirt_public.syms | 2 +
src/qemu/qemu_command.c | 33 ++
src/qemu/qemu_driver.c | 338 ++++++++++++++++++++
src/qemu/qemu_monitor.c | 36 ++
src/qemu/qemu_monitor.h | 22 ++
src/qemu/qemu_monitor_json.c | 185 +++++++++++
src/qemu/qemu_monitor_json.h | 10 +
src/qemu/qemu_monitor_text.c | 164 ++++++++++
src/qemu/qemu_monitor_text.h | 10 +
src/remote/remote_driver.c | 96 ++++++
src/remote/remote_protocol.x | 26 ++-
src/remote_protocol-structs | 24 ++
src/util/xml.h | 2 +
.../qemuxml2argv-blkdeviotune.args | 4 +
.../qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml | 37 +++
tests/qemuxml2argvtest.c | 1 +
tests/qemuxml2xmltest.c | 1 +
tools/virsh.c | 240 ++++++++++++++
tools/virsh.pod | 23 ++
30 files changed, 1958 insertions(+), 4 deletions(-)
--
Lei
13 years
[libvirt] [PATCH 0/5] expose per-device blkio weight tuning, via string param
by Hu Tao
based on v6 by Eric.
v6: https://www.redhat.com/archives/libvir-list/2011-November/msg00202.html
Patches 1-3 are identical to v6 and have been already ACKed. posted here for
your convenience.
changes in patch 4:
- fix some memory leaks
- type of device weight changed to unsigned int
- replace strncpy with virStrcpy
changes in patch 5:
- remove virCgroupGetBlkioDeviceWeight
- live value of blkio.device_weight is read from vm's def
- commas to seprate fields rather than commas between device and
weight and semicolon between device-weight pairs
- add virCgroupSetBlkioDeviceWeight to libvirt_private.syms
Eric Blake (3):
API: add VIR_TYPED_PARAM_STRING
API: remote support for VIR_TYPED_PARAM_STRING
API: add trivial qemu support for VIR_TYPED_PARAM_STRING
Hu Tao (2):
blkiotune: add interface for blkiotune.device_weight
blkiotune: add qemu support for blkiotune.device_weight
daemon/remote.c | 88 +++++++++++-----
docs/formatdomain.html.in | 29 +++++-
docs/schemas/domaincommon.rng | 12 ++
include/libvirt/libvirt.h.in | 42 +++++++-
src/conf/domain_conf.c | 138 +++++++++++++++++++++++-
src/conf/domain_conf.h | 17 +++
src/libvirt.c | 92 ++++++++++++++---
src/libvirt_internal.h | 9 ++-
src/libvirt_private.syms | 4 +
src/qemu/qemu_cgroup.c | 22 ++++
src/qemu/qemu_driver.c | 238 +++++++++++++++++++++++++++++++++++++++--
src/remote/remote_driver.c | 28 +++++-
src/remote/remote_protocol.x | 2 +
src/remote_protocol-structs | 2 +
src/rpc/gendispatch.pl | 3 +-
src/util/cgroup.c | 20 ++++
src/util/cgroup.h | 3 +
src/util/util.c | 14 +++
src/util/util.h | 2 +
tools/virsh.c | 44 +++++++-
tools/virsh.pod | 6 +-
21 files changed, 750 insertions(+), 65 deletions(-)
--
1.7.3.1
13 years
[libvirt] [libvirt-glib PATCH] Add vapi dependency to Makefile.am and fix parallel build
by nirbheek@gentoo.org
From: Nirbheek Chauhan <nirbheek(a)gentoo.org>
libvirt-glib-1.0.vapi is needed to generate libvirt-gobject-1.0.vapi
Without an explicit dependency, make -jN fails
Signed-off-by: Nirbheek Chauhan <nirbheek(a)gentoo.org>
---
vapi/Makefile.am | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
index 0af8f6f..2ecc3e3 100644
--- a/vapi/Makefile.am
+++ b/vapi/Makefile.am
@@ -17,7 +17,7 @@ libvirt-glib-1.0.vapi: $(top_builddir)/libvirt-glib/LibvirtGLib-1.0.gir
--library libvirt-glib-1.0 \
$<
-libvirt-gobject-1.0.vapi: $(top_builddir)/libvirt-gobject/LibvirtGObject-1.0.gir
+libvirt-gobject-1.0.vapi: $(top_builddir)/libvirt-gobject/LibvirtGObject-1.0.gir libvirt-glib-1.0.vapi
$(AM_V_GEN)$(VAPIGEN) \
--vapidir=$(builddir) \
--pkg gobject-2.0 \
--
1.7.3.4
13 years
[libvirt] [PATCH] storage: forbid rebuilding existing disk storage pools
by Guido Günther
which would blow away all volumes. Honor VIR_STORAGE_POOL_BUILD_OVERWRITE
to force a rebuild.
This was caught by libvirt-tck's storage/110-disk-pool.t.
Cheers,
-- Guido
---
src/storage/storage_backend_disk.c | 72 ++++++++++++++++++++++++++++++++++--
1 files changed, 68 insertions(+), 4 deletions(-)
diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c
index 82d6e8a..995ad2f 100644
--- a/src/storage/storage_backend_disk.c
+++ b/src/storage/storage_backend_disk.c
@@ -335,6 +335,40 @@ virStorageBackendDiskRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
/**
+ * Check for a valid disk label (partition table) on device
+ *
+ * return: 0 - valid disk label found
+ * >0 - no or unrecognized disk label
+ * <0 - error finding the disk label
+ */
+static int
+virStorageBackendDiskFindLabel(const char* device)
+{
+ const char *const args[] = {
+ device, "print", "--script", NULL,
+ };
+ virCommandPtr cmd = virCommandNew(PARTED);
+ char *output = NULL;
+ int ret = -1;
+
+ virCommandAddArgSet(cmd, args);
+ virCommandAddEnvString(cmd, "LC_ALL=C");
+ virCommandSetOutputBuffer(cmd, &output);
+
+ /* if parted succeeds we have a valid partition table */
+ ret = virCommandRun(cmd, NULL);
+ if (ret < 0) {
+ if (strstr (output, "unrecognised disk label"))
+ ret = 1;
+ }
+
+ virCommandFree(cmd);
+ VIR_FREE(output);
+ return ret;
+}
+
+
+/**
* Write a new partition table header
*/
static int
@@ -342,6 +376,8 @@ virStorageBackendDiskBuildPool(virConnectPtr conn ATTRIBUTE_UNUSED,
virStoragePoolObjPtr pool,
unsigned int flags)
{
+ bool ok_to_mklabel = false;
+ int ret = -1;
/* eg parted /dev/sda mklabel msdos */
const char *prog[] = {
PARTED,
@@ -353,12 +389,40 @@ virStorageBackendDiskBuildPool(virConnectPtr conn ATTRIBUTE_UNUSED,
NULL,
};
- virCheckFlags(0, -1);
+ virCheckFlags(VIR_STORAGE_POOL_BUILD_OVERWRITE |
+ VIR_STORAGE_POOL_BUILD_NO_OVERWRITE, ret);
- if (virRun(prog, NULL) < 0)
- return -1;
+ if (flags == (VIR_STORAGE_POOL_BUILD_OVERWRITE |
+ VIR_STORAGE_POOL_BUILD_NO_OVERWRITE)) {
+ virStorageReportError(VIR_ERR_OPERATION_INVALID,
+ _("Overwrite and no overwrite flags"
+ " are mutually exclusive"));
+ goto error;
+ }
- return 0;
+ if (flags & VIR_STORAGE_POOL_BUILD_OVERWRITE)
+ ok_to_mklabel = true;
+ else {
+ int check;
+
+ check = virStorageBackendDiskFindLabel (
+ pool->def->source.devices[0].path);
+ if (check > 0) {
+ ok_to_mklabel = true;
+ } else if (check < 0) {
+ virStorageReportError(VIR_ERR_OPERATION_FAILED,
+ _("Error checking for disk label"));
+ } else {
+ virStorageReportError(VIR_ERR_OPERATION_INVALID,
+ _("Disk label already present"));
+ }
+ }
+
+ if (ok_to_mklabel)
+ ret = virRun(prog, NULL);
+
+error:
+ return ret;
}
/**
--
1.7.7.1
13 years
[libvirt] [PATCH libvirt-glib 1/6] Add GVirDomainDevice abstract class
by Marc-André Lureau
---
libvirt-gobject/Makefile.am | 3 +
.../libvirt-gobject-domain-device-private.h | 31 +++++
libvirt-gobject/libvirt-gobject-domain-device.c | 139 ++++++++++++++++++++
libvirt-gobject/libvirt-gobject-domain-device.h | 64 +++++++++
libvirt-gobject/libvirt-gobject.h | 1 +
libvirt-gobject/libvirt-gobject.sym | 2 +
6 files changed, 240 insertions(+), 0 deletions(-)
create mode 100644 libvirt-gobject/libvirt-gobject-domain-device-private.h
create mode 100644 libvirt-gobject/libvirt-gobject-domain-device.c
create mode 100644 libvirt-gobject/libvirt-gobject-domain-device.h
diff --git a/libvirt-gobject/Makefile.am b/libvirt-gobject/Makefile.am
index 4f84b8b..56a047e 100644
--- a/libvirt-gobject/Makefile.am
+++ b/libvirt-gobject/Makefile.am
@@ -7,6 +7,7 @@ GOBJECT_HEADER_FILES = \
libvirt-gobject.h \
libvirt-gobject-main.h \
libvirt-gobject-domain-snapshot.h \
+ libvirt-gobject-domain-device.h \
libvirt-gobject-domain.h \
libvirt-gobject-interface.h \
libvirt-gobject-network.h \
@@ -21,6 +22,7 @@ GOBJECT_HEADER_FILES = \
GOBJECT_SOURCE_FILES = \
libvirt-gobject-main.c \
libvirt-gobject-domain-snapshot.c \
+ libvirt-gobject-domain-device.c \
libvirt-gobject-domain.c \
libvirt-gobject-interface.c \
libvirt-gobject-network.c \
@@ -42,6 +44,7 @@ libvirt_gobject_1_0_la_HEADERS = \
$(GOBJECT_HEADER_FILES) \
libvirt-gobject-input-stream.h
nodist_libvirt_gobject_1_0_la_HEADERS = \
+ libvirt-gobject-domain-device-private.h \
libvirt-gobject-enums.h
libvirt_gobject_1_0_la_SOURCES = \
$(libvirt_gobject_1_0_la_HEADERS) \
diff --git a/libvirt-gobject/libvirt-gobject-domain-device-private.h b/libvirt-gobject/libvirt-gobject-domain-device-private.h
new file mode 100644
index 0000000..2a34309
--- /dev/null
+++ b/libvirt-gobject/libvirt-gobject-domain-device-private.h
@@ -0,0 +1,31 @@
+/*
+ * libvirt-gobject-domain-device-private.h: libvirt gobject integration
+ *
+ * Copyright (C) 2011 Red Hat
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Marc-André Lureau <marcandre.lureau(a)redhat.com>
+ */
+#ifndef __LIBVIRT_GOBJECT_DOMAIN_DEVICE_PRIVATE_H__
+#define __LIBVIRT_GOBJECT_DOMAIN_DEVICE_PRIVATEH__
+
+G_BEGIN_DECLS
+
+virDomainPtr gvir_domain_device_get_domain_handle(GVirDomainDevice *self);
+
+G_END_DECLS
+
+#endif /* __LIBVIRT_GOBJECT_DOMAIN_DEVICE_PRIVATEH__ */
diff --git a/libvirt-gobject/libvirt-gobject-domain-device.c b/libvirt-gobject/libvirt-gobject-domain-device.c
new file mode 100644
index 0000000..ae03489
--- /dev/null
+++ b/libvirt-gobject/libvirt-gobject-domain-device.c
@@ -0,0 +1,139 @@
+/*
+ * libvirt-gobject-domain-device.c: libvirt gobject integration
+ *
+ * Copyright (C) 2011 Red Hat
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Marc-André Lureau <marcandre.lureau(a)redhat.com>
+ */
+
+#include <config.h>
+
+#include <libvirt/virterror.h>
+#include <string.h>
+
+#include "libvirt-glib/libvirt-glib.h"
+#include "libvirt-gobject/libvirt-gobject.h"
+
+#include "libvirt-gobject/libvirt-gobject-domain-device-private.h"
+
+extern gboolean debugFlag;
+
+#define DEBUG(fmt, ...) do { if (G_UNLIKELY(debugFlag)) g_debug(fmt, ## __VA_ARGS__); } while (0)
+
+#define GVIR_DOMAIN_DEVICE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE((obj), GVIR_TYPE_DOMAIN_DEVICE, GVirDomainDevicePrivate))
+
+struct _GVirDomainDevicePrivate
+{
+ GVirDomain *domain;
+};
+
+G_DEFINE_ABSTRACT_TYPE(GVirDomainDevice, gvir_domain_device, G_TYPE_OBJECT);
+
+enum {
+ PROP_0,
+ PROP_DOMAIN,
+};
+
+static void gvir_domain_device_get_property(GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GVirDomainDevice *self = GVIR_DOMAIN_DEVICE(object);
+ GVirDomainDevicePrivate *priv = self->priv;
+
+ switch (prop_id) {
+ case PROP_DOMAIN:
+ g_value_set_object(value, priv->domain);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ }
+}
+
+
+static void gvir_domain_device_set_property(GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GVirDomainDevice *self = GVIR_DOMAIN_DEVICE(object);
+ GVirDomainDevicePrivate *priv = self->priv;
+
+ switch (prop_id) {
+ case PROP_DOMAIN:
+ g_clear_object(&priv->domain);
+ priv->domain = g_value_dup_object(value);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ }
+}
+
+
+static void gvir_domain_device_finalize(GObject *object)
+{
+ GVirDomainDevice *self = GVIR_DOMAIN_DEVICE(object);
+ GVirDomainDevicePrivate *priv = self->priv;
+
+ DEBUG("Finalize GVirDomainDevice=%p", self);
+
+ g_clear_object(&priv->domain);
+
+ G_OBJECT_CLASS(gvir_domain_device_parent_class)->finalize(object);
+}
+
+static void gvir_domain_device_class_init(GVirDomainDeviceClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = gvir_domain_device_finalize;
+ object_class->get_property = gvir_domain_device_get_property;
+ object_class->set_property = gvir_domain_device_set_property;
+
+ g_object_class_install_property(object_class,
+ PROP_DOMAIN,
+ g_param_spec_object("domain",
+ "domain",
+ "The associated domain",
+ GVIR_TYPE_DOMAIN,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
+
+ g_type_class_add_private(klass, sizeof(GVirDomainDevicePrivate));
+}
+
+static void gvir_domain_device_init(GVirDomainDevice *self)
+{
+ DEBUG("Init GVirDomainDevice=%p", self);
+
+ self->priv = GVIR_DOMAIN_DEVICE_GET_PRIVATE(self);
+}
+
+G_GNUC_INTERNAL
+virDomainPtr gvir_domain_device_get_domain_handle(GVirDomainDevice *self)
+{
+ virDomainPtr handle;
+
+ g_object_get(self->priv->domain, "handle", &handle, NULL);
+
+ return handle;
+}
diff --git a/libvirt-gobject/libvirt-gobject-domain-device.h b/libvirt-gobject/libvirt-gobject-domain-device.h
new file mode 100644
index 0000000..35d70f5
--- /dev/null
+++ b/libvirt-gobject/libvirt-gobject-domain-device.h
@@ -0,0 +1,64 @@
+/*
+ * libvirt-gobject-domain-device.h: libvirt gobject integration
+ *
+ * Copyright (C) 2011 Red Hat
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Marc-André Lureau <marcandre.lureau(a)redhat.com>
+ */
+
+#if !defined(__LIBVIRT_GOBJECT_H__) && !defined(LIBVIRT_GOBJECT_BUILD)
+#error "Only <libvirt-gobject/libvirt-gobject.h> can be included directly."
+#endif
+
+#ifndef __LIBVIRT_GOBJECT_DOMAIN_DEVICE_H__
+#define __LIBVIRT_GOBJECT_DOMAIN_DEVICE_H__
+
+G_BEGIN_DECLS
+
+#define GVIR_TYPE_DOMAIN_DEVICE (gvir_domain_device_get_type ())
+#define GVIR_DOMAIN_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GVIR_TYPE_DOMAIN_DEVICE, GVirDomainDevice))
+#define GVIR_DOMAIN_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GVIR_TYPE_DOMAIN_DEVICE, GVirDomainDeviceClass))
+#define GVIR_IS_DOMAIN_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GVIR_TYPE_DOMAIN_DEVICE))
+#define GVIR_IS_DOMAIN_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GVIR_TYPE_DOMAIN_DEVICE))
+#define GVIR_DOMAIN_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GVIR_TYPE_DOMAIN_DEVICE, GVirDomainDeviceClass))
+
+typedef struct _GVirDomainDevice GVirDomainDevice;
+typedef struct _GVirDomainDevicePrivate GVirDomainDevicePrivate;
+typedef struct _GVirDomainDeviceClass GVirDomainDeviceClass;
+
+struct _GVirDomainDevice
+{
+ GObject parent;
+
+ GVirDomainDevicePrivate *priv;
+
+ /* Do not add fields to this struct */
+};
+
+struct _GVirDomainDeviceClass
+{
+ GObjectClass parent_class;
+
+ gpointer padding[20];
+};
+
+
+GType gvir_domain_device_get_type(void);
+
+G_END_DECLS
+
+#endif /* __LIBVIRT_GOBJECT_DOMAIN_DEVICE_H__ */
diff --git a/libvirt-gobject/libvirt-gobject.h b/libvirt-gobject/libvirt-gobject.h
index 12124e9..3bec2c9 100644
--- a/libvirt-gobject/libvirt-gobject.h
+++ b/libvirt-gobject/libvirt-gobject.h
@@ -30,6 +30,7 @@
#include <libvirt-gobject/libvirt-gobject-main.h>
#include <libvirt-gobject/libvirt-gobject-enums.h>
#include <libvirt-gobject/libvirt-gobject-stream.h>
+#include <libvirt-gobject/libvirt-gobject-domain-device.h>
#include <libvirt-gobject/libvirt-gobject-domain-snapshot.h>
#include <libvirt-gobject/libvirt-gobject-domain.h>
#include <libvirt-gobject/libvirt-gobject-interface.h>
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index f0e8402..da03001 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -29,6 +29,8 @@ LIBVIRT_GOBJECT_0.0.1 {
gvir_connection_create_domain;
gvir_connection_create_storage_pool;
+ gvir_domain_device_get_type;
+
gvir_domain_get_type;
gvir_domain_handle_get_type;
gvir_domain_info_get_type;
--
1.7.7
13 years
[libvirt] [PATCH TECHPREVIEW RFC 0/4] LibSSH2 transport option for libvirt
by Peter Krempa
This patchset adds a new secure transport layer to enable secure connections
without the need to spawn external processes. The layer is implemented into virNetSocket.
This patches still lack some functionality, which I will add before the final
version is done, but I'd like to have some feedback about the features and mistakes
I made, so I can incorporate them into the final version.
Unfortunately, while working with libssh2, I found several bugs, and older versions
(1.2.2, which is default in gentoo) are unusable (same error codes on authentication failure
and closed socket and others). I decided to limit version of libssh2 to 1.3.0 for
the transport to work.
Please let me know if you find something that would you like to see implemented
or improoved or I've done wrong, or you've got some questions.
Usage:
virsh -c qemu+libssh://root@locahost:22/system (user/port/host may be omitted,
these are defaults)
Possible problems:
- segmentation fault in libssh2 when corrupted known_hosts file is used
(will investigate)
Things that have to be done:
- private key authentication
- SSH agent support
- Add unknown host key dialog
- documentation
- change error codes and messages (any suggestions?)
Thanks for your time
Peter
Peter Krempa (4):
libssh2_transport: add main libssh2 transport implementation
libssh2_transport: add ssh context support to virNetSocket
libssh2_transport: Add libssh2 session support to net client code
libssh2_transport: Use libssh2 driver code in remote driver
configure.ac | 40 ++-
po/POTFILES.in | 1 +
src/Makefile.am | 9 +
src/libvirt_private.syms | 1 +
src/remote/remote_driver.c | 97 ++++--
src/rpc/virnetclient.c | 66 +++
src/rpc/virnetclient.h | 11 +
src/rpc/virnetlibsshcontext.c | 900 +++++++++++++++++++++++++++++++++++++++++
src/rpc/virnetlibsshcontext.h | 76 ++++
src/rpc/virnetsocket.c | 137 +++++++-
src/rpc/virnetsocket.h | 12 +
11 files changed, 1318 insertions(+), 32 deletions(-)
create mode 100644 src/rpc/virnetlibsshcontext.c
create mode 100644 src/rpc/virnetlibsshcontext.h
--
1.7.3.4
13 years
[libvirt] [PATCH libvirt-glib 1/3] Add GVirDomainDevice abstract class
by Marc-André Lureau
---
libvirt-gobject/Makefile.am | 3 +
.../libvirt-gobject-domain-device-private.h | 31 +++++
libvirt-gobject/libvirt-gobject-domain-device.c | 139 ++++++++++++++++++++
libvirt-gobject/libvirt-gobject-domain-device.h | 64 +++++++++
libvirt-gobject/libvirt-gobject.h | 1 +
libvirt-gobject/libvirt-gobject.sym | 2 +
6 files changed, 240 insertions(+), 0 deletions(-)
create mode 100644 libvirt-gobject/libvirt-gobject-domain-device-private.h
create mode 100644 libvirt-gobject/libvirt-gobject-domain-device.c
create mode 100644 libvirt-gobject/libvirt-gobject-domain-device.h
diff --git a/libvirt-gobject/Makefile.am b/libvirt-gobject/Makefile.am
index 4f84b8b..56a047e 100644
--- a/libvirt-gobject/Makefile.am
+++ b/libvirt-gobject/Makefile.am
@@ -7,6 +7,7 @@ GOBJECT_HEADER_FILES = \
libvirt-gobject.h \
libvirt-gobject-main.h \
libvirt-gobject-domain-snapshot.h \
+ libvirt-gobject-domain-device.h \
libvirt-gobject-domain.h \
libvirt-gobject-interface.h \
libvirt-gobject-network.h \
@@ -21,6 +22,7 @@ GOBJECT_HEADER_FILES = \
GOBJECT_SOURCE_FILES = \
libvirt-gobject-main.c \
libvirt-gobject-domain-snapshot.c \
+ libvirt-gobject-domain-device.c \
libvirt-gobject-domain.c \
libvirt-gobject-interface.c \
libvirt-gobject-network.c \
@@ -42,6 +44,7 @@ libvirt_gobject_1_0_la_HEADERS = \
$(GOBJECT_HEADER_FILES) \
libvirt-gobject-input-stream.h
nodist_libvirt_gobject_1_0_la_HEADERS = \
+ libvirt-gobject-domain-device-private.h \
libvirt-gobject-enums.h
libvirt_gobject_1_0_la_SOURCES = \
$(libvirt_gobject_1_0_la_HEADERS) \
diff --git a/libvirt-gobject/libvirt-gobject-domain-device-private.h b/libvirt-gobject/libvirt-gobject-domain-device-private.h
new file mode 100644
index 0000000..2a34309
--- /dev/null
+++ b/libvirt-gobject/libvirt-gobject-domain-device-private.h
@@ -0,0 +1,31 @@
+/*
+ * libvirt-gobject-domain-device-private.h: libvirt gobject integration
+ *
+ * Copyright (C) 2011 Red Hat
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Marc-André Lureau <marcandre.lureau(a)redhat.com>
+ */
+#ifndef __LIBVIRT_GOBJECT_DOMAIN_DEVICE_PRIVATE_H__
+#define __LIBVIRT_GOBJECT_DOMAIN_DEVICE_PRIVATEH__
+
+G_BEGIN_DECLS
+
+virDomainPtr gvir_domain_device_get_domain_handle(GVirDomainDevice *self);
+
+G_END_DECLS
+
+#endif /* __LIBVIRT_GOBJECT_DOMAIN_DEVICE_PRIVATEH__ */
diff --git a/libvirt-gobject/libvirt-gobject-domain-device.c b/libvirt-gobject/libvirt-gobject-domain-device.c
new file mode 100644
index 0000000..ae03489
--- /dev/null
+++ b/libvirt-gobject/libvirt-gobject-domain-device.c
@@ -0,0 +1,139 @@
+/*
+ * libvirt-gobject-domain-device.c: libvirt gobject integration
+ *
+ * Copyright (C) 2011 Red Hat
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Marc-André Lureau <marcandre.lureau(a)redhat.com>
+ */
+
+#include <config.h>
+
+#include <libvirt/virterror.h>
+#include <string.h>
+
+#include "libvirt-glib/libvirt-glib.h"
+#include "libvirt-gobject/libvirt-gobject.h"
+
+#include "libvirt-gobject/libvirt-gobject-domain-device-private.h"
+
+extern gboolean debugFlag;
+
+#define DEBUG(fmt, ...) do { if (G_UNLIKELY(debugFlag)) g_debug(fmt, ## __VA_ARGS__); } while (0)
+
+#define GVIR_DOMAIN_DEVICE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE((obj), GVIR_TYPE_DOMAIN_DEVICE, GVirDomainDevicePrivate))
+
+struct _GVirDomainDevicePrivate
+{
+ GVirDomain *domain;
+};
+
+G_DEFINE_ABSTRACT_TYPE(GVirDomainDevice, gvir_domain_device, G_TYPE_OBJECT);
+
+enum {
+ PROP_0,
+ PROP_DOMAIN,
+};
+
+static void gvir_domain_device_get_property(GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GVirDomainDevice *self = GVIR_DOMAIN_DEVICE(object);
+ GVirDomainDevicePrivate *priv = self->priv;
+
+ switch (prop_id) {
+ case PROP_DOMAIN:
+ g_value_set_object(value, priv->domain);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ }
+}
+
+
+static void gvir_domain_device_set_property(GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GVirDomainDevice *self = GVIR_DOMAIN_DEVICE(object);
+ GVirDomainDevicePrivate *priv = self->priv;
+
+ switch (prop_id) {
+ case PROP_DOMAIN:
+ g_clear_object(&priv->domain);
+ priv->domain = g_value_dup_object(value);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ }
+}
+
+
+static void gvir_domain_device_finalize(GObject *object)
+{
+ GVirDomainDevice *self = GVIR_DOMAIN_DEVICE(object);
+ GVirDomainDevicePrivate *priv = self->priv;
+
+ DEBUG("Finalize GVirDomainDevice=%p", self);
+
+ g_clear_object(&priv->domain);
+
+ G_OBJECT_CLASS(gvir_domain_device_parent_class)->finalize(object);
+}
+
+static void gvir_domain_device_class_init(GVirDomainDeviceClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = gvir_domain_device_finalize;
+ object_class->get_property = gvir_domain_device_get_property;
+ object_class->set_property = gvir_domain_device_set_property;
+
+ g_object_class_install_property(object_class,
+ PROP_DOMAIN,
+ g_param_spec_object("domain",
+ "domain",
+ "The associated domain",
+ GVIR_TYPE_DOMAIN,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
+
+ g_type_class_add_private(klass, sizeof(GVirDomainDevicePrivate));
+}
+
+static void gvir_domain_device_init(GVirDomainDevice *self)
+{
+ DEBUG("Init GVirDomainDevice=%p", self);
+
+ self->priv = GVIR_DOMAIN_DEVICE_GET_PRIVATE(self);
+}
+
+G_GNUC_INTERNAL
+virDomainPtr gvir_domain_device_get_domain_handle(GVirDomainDevice *self)
+{
+ virDomainPtr handle;
+
+ g_object_get(self->priv->domain, "handle", &handle, NULL);
+
+ return handle;
+}
diff --git a/libvirt-gobject/libvirt-gobject-domain-device.h b/libvirt-gobject/libvirt-gobject-domain-device.h
new file mode 100644
index 0000000..35d70f5
--- /dev/null
+++ b/libvirt-gobject/libvirt-gobject-domain-device.h
@@ -0,0 +1,64 @@
+/*
+ * libvirt-gobject-domain-device.h: libvirt gobject integration
+ *
+ * Copyright (C) 2011 Red Hat
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Marc-André Lureau <marcandre.lureau(a)redhat.com>
+ */
+
+#if !defined(__LIBVIRT_GOBJECT_H__) && !defined(LIBVIRT_GOBJECT_BUILD)
+#error "Only <libvirt-gobject/libvirt-gobject.h> can be included directly."
+#endif
+
+#ifndef __LIBVIRT_GOBJECT_DOMAIN_DEVICE_H__
+#define __LIBVIRT_GOBJECT_DOMAIN_DEVICE_H__
+
+G_BEGIN_DECLS
+
+#define GVIR_TYPE_DOMAIN_DEVICE (gvir_domain_device_get_type ())
+#define GVIR_DOMAIN_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GVIR_TYPE_DOMAIN_DEVICE, GVirDomainDevice))
+#define GVIR_DOMAIN_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GVIR_TYPE_DOMAIN_DEVICE, GVirDomainDeviceClass))
+#define GVIR_IS_DOMAIN_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GVIR_TYPE_DOMAIN_DEVICE))
+#define GVIR_IS_DOMAIN_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GVIR_TYPE_DOMAIN_DEVICE))
+#define GVIR_DOMAIN_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GVIR_TYPE_DOMAIN_DEVICE, GVirDomainDeviceClass))
+
+typedef struct _GVirDomainDevice GVirDomainDevice;
+typedef struct _GVirDomainDevicePrivate GVirDomainDevicePrivate;
+typedef struct _GVirDomainDeviceClass GVirDomainDeviceClass;
+
+struct _GVirDomainDevice
+{
+ GObject parent;
+
+ GVirDomainDevicePrivate *priv;
+
+ /* Do not add fields to this struct */
+};
+
+struct _GVirDomainDeviceClass
+{
+ GObjectClass parent_class;
+
+ gpointer padding[20];
+};
+
+
+GType gvir_domain_device_get_type(void);
+
+G_END_DECLS
+
+#endif /* __LIBVIRT_GOBJECT_DOMAIN_DEVICE_H__ */
diff --git a/libvirt-gobject/libvirt-gobject.h b/libvirt-gobject/libvirt-gobject.h
index 12124e9..3bec2c9 100644
--- a/libvirt-gobject/libvirt-gobject.h
+++ b/libvirt-gobject/libvirt-gobject.h
@@ -30,6 +30,7 @@
#include <libvirt-gobject/libvirt-gobject-main.h>
#include <libvirt-gobject/libvirt-gobject-enums.h>
#include <libvirt-gobject/libvirt-gobject-stream.h>
+#include <libvirt-gobject/libvirt-gobject-domain-device.h>
#include <libvirt-gobject/libvirt-gobject-domain-snapshot.h>
#include <libvirt-gobject/libvirt-gobject-domain.h>
#include <libvirt-gobject/libvirt-gobject-interface.h>
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index f0e8402..da03001 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -29,6 +29,8 @@ LIBVIRT_GOBJECT_0.0.1 {
gvir_connection_create_domain;
gvir_connection_create_storage_pool;
+ gvir_domain_device_get_type;
+
gvir_domain_get_type;
gvir_domain_handle_get_type;
gvir_domain_info_get_type;
--
1.7.7
13 years
[libvirt] make install libvirt failled.
by ShaoHe Feng
I make install libvirt failed on my Ubuntu 11.11.
I think some html dependent packages are missed on my build environment.
Does anyone know the reason? Thanks.
the info of make install is as follow:
/bin/bash /home/fsh/work/VM/libvirt/build-aux/install-sh -d
/usr/share/doc/libvirt-0.9.6/html
for f in generic.css libvirt.css main.css api.html api_extension.html
apps.html archdomain.html architecture.html archnetwork.html
archnode.html archstorage.html auth.html bindings.html bugs.html
compiling.html contact.html csharp.html deployment.html devguide.html
docs.html downloads.html drivers.html drvesx.html drvhyperv.html
drvlxc.html drvopenvz.html drvqemu.html drvremote.html drvtest.html
drvuml.html drvvbox.html drvvmware.html drvxen.html errors.html
firewall.html format.html formatcaps.html formatdomain.html
formatnetwork.html formatnode.html formatnwfilter.html formatsecret.html
formatsnapshot.html formatstorage.html formatstorageencryption.html
goals.html hacking.html hooks.html hvsupport.html index.html
internals.html intro.html java.html locking.html logging.html news.html
php.html python.html relatedlinks.html remote.html sitemap.html
storage.html testapi.html testsuites.html testtck.html todo.html
uri.html virshcmdref.html windows.html todo.html hvsupport.html
internals/command.html internals/locking.html internals/rpc.html
architecture.gif node.gif 32favicon.png footer_corner.png
footer_pattern.png libvirt-header-bg.png libvirt-header-logo.png
libvirtLogo.png libvirt-net-logical.png libvirt-net-physical.png
libvirt-daemon-arch.png libvirt-driver-arch.png libvirt-object-model.png
madeWith.png et.png; do \
/usr/bin/install -c -m 0644 ./$f
/usr/share/doc/libvirt-0.9.6/html; done
/usr/bin/install: cannot stat `./api.html': No such file or directory
/usr/bin/install: cannot stat `./api_extension.html': No such file or
directory
/usr/bin/install: cannot stat `./apps.html': No such file or directory
/usr/bin/install: cannot stat `./archdomain.html': No such file or directory
/usr/bin/install: cannot stat `./architecture.html': No such file or
directory
/usr/bin/install: cannot stat `./archnetwork.html': No such file or
directory
/usr/bin/install: cannot stat `./archnode.html': No such file or directory
/usr/bin/install: cannot stat `./archstorage.html': No such file or
directory
/usr/bin/install: cannot stat `./auth.html': No such file or directory
/usr/bin/install: cannot stat `./bindings.html': No such file or directory
/usr/bin/install: cannot stat `./bugs.html': No such file or directory
/usr/bin/install: cannot stat `./compiling.html': No such file or directory
/usr/bin/install: cannot stat `./contact.html': No such file or directory
/usr/bin/install: cannot stat `./csharp.html': No such file or directory
/usr/bin/install: cannot stat `./deployment.html': No such file or directory
/usr/bin/install: cannot stat `./devguide.html': No such file or directory
/usr/bin/install: cannot stat `./docs.html': No such file or directory
/usr/bin/install: cannot stat `./downloads.html': No such file or directory
/usr/bin/install: cannot stat `./drivers.html': No such file or directory
/usr/bin/install: cannot stat `./drvesx.html': No such file or directory
/usr/bin/install: cannot stat `./drvhyperv.html': No such file or directory
/usr/bin/install: cannot stat `./drvlxc.html': No such file or directory
/usr/bin/install: cannot stat `./drvopenvz.html': No such file or directory
/usr/bin/install: cannot stat `./drvqemu.html': No such file or directory
/usr/bin/install: cannot stat `./drvremote.html': No such file or directory
/usr/bin/install: cannot stat `./drvtest.html': No such file or directory
/usr/bin/install: cannot stat `./drvuml.html': No such file or directory
/usr/bin/install: cannot stat `./drvvbox.html': No such file or directory
/usr/bin/install: cannot stat `./drvvmware.html': No such file or directory
/usr/bin/install: cannot stat `./drvxen.html': No such file or directory
/usr/bin/install: cannot stat `./errors.html': No such file or directory
/usr/bin/install: cannot stat `./firewall.html': No such file or directory
/usr/bin/install: cannot stat `./format.html': No such file or directory
/usr/bin/install: cannot stat `./formatcaps.html': No such file or directory
/usr/bin/install: cannot stat `./formatdomain.html': No such file or
directory
/usr/bin/install: cannot stat `./formatnetwork.html': No such file or
directory
/usr/bin/install: cannot stat `./formatnode.html': No such file or directory
/usr/bin/install: cannot stat `./formatnwfilter.html': No such file or
directory
/usr/bin/install: cannot stat `./formatsecret.html': No such file or
directory
/usr/bin/install: cannot stat `./formatsnapshot.html': No such file or
directory
/usr/bin/install: cannot stat `./formatstorage.html': No such file or
directory
/usr/bin/install: cannot stat `./formatstorageencryption.html': No such
file or directory
/usr/bin/install: cannot stat `./goals.html': No such file or directory
/usr/bin/install: cannot stat `./hacking.html': No such file or directory
/usr/bin/install: cannot stat `./hooks.html': No such file or directory
/usr/bin/install: cannot stat `./hvsupport.html': No such file or directory
/usr/bin/install: cannot stat `./index.html': No such file or directory
/usr/bin/install: cannot stat `./internals.html': No such file or directory
/usr/bin/install: cannot stat `./intro.html': No such file or directory
/usr/bin/install: cannot stat `./java.html': No such file or directory
/usr/bin/install: cannot stat `./locking.html': No such file or directory
/usr/bin/install: cannot stat `./logging.html': No such file or directory
/usr/bin/install: cannot stat `./news.html': No such file or directory
/usr/bin/install: cannot stat `./php.html': No such file or directory
/usr/bin/install: cannot stat `./python.html': No such file or directory
/usr/bin/install: cannot stat `./relatedlinks.html': No such file or
directory
/usr/bin/install: cannot stat `./remote.html': No such file or directory
/usr/bin/install: cannot stat `./sitemap.html': No such file or directory
/usr/bin/install: cannot stat `./storage.html': No such file or directory
/usr/bin/install: cannot stat `./testapi.html': No such file or directory
/usr/bin/install: cannot stat `./testsuites.html': No such file or directory
/usr/bin/install: cannot stat `./testtck.html': No such file or directory
/usr/bin/install: cannot stat `./todo.html': No such file or directory
/usr/bin/install: cannot stat `./uri.html': No such file or directory
/usr/bin/install: cannot stat `./virshcmdref.html': No such file or
directory
/usr/bin/install: cannot stat `./windows.html': No such file or directory
/usr/bin/install: cannot stat `./todo.html': No such file or directory
/usr/bin/install: cannot stat `./hvsupport.html': No such file or directory
/usr/bin/install: cannot stat `./internals/command.html': No such file
or directory
/usr/bin/install: cannot stat `./internals/locking.html': No such file
or directory
/usr/bin/install: cannot stat `./internals/rpc.html': No such file or
directory
/bin/bash /home/fsh/work/VM/libvirt/build-aux/install-sh -d
/usr/share/doc/libvirt-0.9.6/html/html
for h in html/index.html html/libvirt-libvirt.html
html/libvirt-virterror.html; do \
/usr/bin/install -c -m 0644 ./$h
/usr/share/doc/libvirt-0.9.6/html/html; done
/usr/bin/install: cannot stat `./html/index.html': No such file or directory
/usr/bin/install: cannot stat `./html/libvirt-libvirt.html': No such
file or directory
/usr/bin/install: cannot stat `./html/libvirt-virterror.html': No such
file or directory
make[4]: *** [install-data-local] Error 1
make[4]: Leaving directory `/home/fsh/work/VM/libvirt/docs'
make[3]: *** [install-am] Error 2
make[3]: Leaving directory `/home/fsh/work/VM/libvirt/docs'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/fsh/work/VM/libvirt/docs'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/fsh/work/VM/libvirt/docs'
make: *** [install-recursive] Error 1
13 years
[libvirt] [test-API][PATCH 1/2] update env_clear for new way of function reference
by Guannan Ren
---
env_clear.py | 23 ++++++++++-------------
1 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/env_clear.py b/env_clear.py
index 302ff62..5e78ab5 100644
--- a/env_clear.py
+++ b/env_clear.py
@@ -14,7 +14,7 @@
# distribution and at <http://www.gnu.org/licenses>.
#
# This module matches the reference of clearing function from each testcase
-# to the corresponding testcase's argument in the order of testcase running
+# to the corresponding testcase's argument in the order of testcase running
#
import mapper
@@ -28,17 +28,17 @@ class EnvClear(object):
self.cases_clearfunc_ref_dict = cases_clearfunc_ref_dict
self.logfile = logfile
self.loglevel = loglevel
-
+
mapper_obj = mapper.Mapper(activity)
- pkg_tripped_cases = mapper_obj.get_package_tripped()
+ clean_pkg_casename_func = mapper_obj.clean_package_casename_func_map()
self.cases_ref_names = []
- for case in pkg_tripped_cases:
+ for case in clean_pkg_casename_func:
case_ref_name = case.keys()[0]
self.cases_ref_names.append(case_ref_name)
self.cases_params_list = []
- for case in pkg_tripped_cases:
+ for case in clean_pkg_casename_func:
case_params = case.values()[0]
self.cases_params_list.append(case_params)
@@ -48,10 +48,10 @@ class EnvClear(object):
def env_clear(self):
""" Run each clearing function with the corresponding arguments """
-
+
envlog = log.EnvLog(self.logfile, self.loglevel)
logger = envlog.env_log()
-
+
testcase_number = len(self.cases_ref_names)
for i in range(testcase_number):
@@ -59,12 +59,9 @@ class EnvClear(object):
case_ref_name = self.cases_ref_names[i]
case_params = self.cases_params_list[i]
- if case_ref_name == 'sleep':
- continue
- else:
- case_params['logger'] = logger
- self.cases_clearfunc_ref_dict[case_ref_name](case_params)
+ case_params['logger'] = logger
+ self.cases_clearfunc_ref_dict[case_ref_name](case_params)
del envlog
- return 0
+ return 0
--
1.7.1
13 years
[libvirt] using php-libvirt libvirt_domain_is_active function
by Eduard B
Hi All,
Im trying to figure how to use libvirt_domain_is_active but I'm unable to find what I am doing wrong.
I tested it with php-libvirt-0.4.4 an with 0.4.3 but i have the same problem
Im using libvirt-0.9.6-2.fc16.x86_64 with the following code
Can someone point me in the right direction with the use of libvirt_domain_is_active ?
Thanks
------8<------CODE --------8<------------------------------------
print_r ( libvirt_version() );
$domains=libvirt_list_domains($conn);
print_r ($domains);
foreach ( $domains as $domain ) {
print "$domain\n";
print libvirt_domain_is_active($domain);
}
---------8<------- OUTPUT ----------------8<-------------------
Array
(
[libvirt.release] => 6
[libvirt.minor] => 9
[libvirt.major] => 0
[connector.version] => 0.4.3
[connector.major] => 0
[connector.minor] => 4
[connector.release] => 3
)
Array
(
[0] => Domain-0
[1] => vm1
[2] => vm2
[3] => vm3
)
Domain-0
PHP Warning: libvirt_domain_is_active() expects parameter 1 to be resource, integer given in /var/www/html/libvirt/index.php on line 20
PHP Warning: libvirt_domain_is_active(): Invalid arguments in /var/www/html/libvirt/index.php on line 20
vm1
PHP Warning: libvirt_domain_is_active() expects parameter 1 to be resource, integer given in /var/www/html/libvirt/index.php on line 20
PHP Warning: libvirt_domain_is_active(): Invalid arguments in /var/www/html/libvirt/index.php on line 20
vm2
PHP Warning: libvirt_domain_is_active() expects parameter 1 to be resource, integer given in /var/www/html/libvirt/index.php on line 20
PHP Warning: libvirt_domain_is_active(): Invalid arguments in /var/www/html/libvirt/index.php on line 20
vm3
PHP Warning: libvirt_domain_is_active() expects parameter 1 to be resource, integer given in /var/www/html/libvirt/index.php on line 20
PHP Warning: libvirt_domain_is_active(): Invalid arguments in /var/www/html/libvirt/index.php on line 20
13 years