[libvirt] [PATCH V2 0/4] Support for multiple IP addresses using lists
by Stefan Berger
This patch series builds on the previously posted patch series
https://www.redhat.com/archives/libvir-list/2011-October/msg00912.html
and introduces the capability to assign a list to a variable and
have multiple rules instantiated, one for each item in the list.
This means, that if for example a variable like IP has been assigned
the following values
IP = [1.2.3.4, 5.6.7.8, 10.0.0.1]
it will generate 3 rules, which then in turn allows us to build filters
that can evaluate multiple possible values per field, i.e., allow
the filtering for multiple IP addresses (per interface).
It would then need David Steven's patch for support of 'RETURN' (and
'CONTINUE') target(s).
v2:
- reimplementation of iterator
- other nits
Regards,
Stefan
13 years, 1 month
[libvirt] [PATCH] storage: Fix error message on vol-create-from failure
by Ryota Ozaki
If vol-create-from is failed due to 'input volume not found',
virsh outputs like this:
$ sudo virsh vol-create-from testpool test-vol.xml test.img
error: failed to get vol 'test.img', specifying --pool might help
error: Storage volume not found: no storage vol with matching path
However, '--pool' is incorrect because it is already specified as
second argument ('testpool' in this case). It should be "--inputpool".
The patch fixes this by using pooloptname, which will be "inputpool"
in this case and "pool" in other cases, as error message.
---
tools/virsh.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 72344f0..5544a41 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -15216,8 +15216,8 @@ vshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd,
if (pool)
vshError(ctl, _("failed to get vol '%s'"), n);
else
- vshError(ctl, _("failed to get vol '%s', specifying --pool "
- "might help"), n);
+ vshError(ctl, _("failed to get vol '%s', specifying --%s "
+ "might help"), n, pooloptname);
}
if (pool)
--
1.7.4.1
13 years, 1 month
[libvirt] [PATCH] qemu: Forbid specify target path for disk vol
by Osier Yang
target path for disk vol is just meaningless, and it's never used
but free()ed silently when creating the volume.
---
src/conf/storage_conf.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index e893b2d..5f4f264 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -1052,6 +1052,12 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool,
}
ret->target.path = virXPathString("string(./target/path)", ctxt);
+ if (ret->target.path && (pool->type == VIR_STORAGE_POOL_DISK)) {
+ virStorageReportError(VIR_ERR_XML_ERROR, "%s",
+ _("target path for disk vol is just meaningless"));
+ goto cleanup;
+ }
+
if (options->formatFromString) {
char *format = virXPathString("string(./target/format/@type)", ctxt);
if (format == NULL)
--
1.7.6
13 years, 1 month
[libvirt] Expose qemu monitor command query_block?
by Osier Yang
Command "query-block" is only used internally for medium's
checking before migration currently. Should we expose it
as a public API, such as virDomainQueryBlock (or a qemu
specific API, virDomainQemuQueryBlock)?
It has enough useful infomation which user may care out,
such as "io-status", "locked", "removable", "inserted". And
perhaps more info in future.
Osier
13 years, 1 month
[libvirt] [PATCH][Take2] virsh: Fix vol-info's 'Type' output
by Ryota Ozaki
We have a new vol type "dir" in addition to "file" and "block", but
virsh doesn't know it. Fix it.
Additionally, the patch lets virsh output "unknown" if not matched
any of them.
---
tools/virsh.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 42f62d7..72344f0 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -9540,9 +9540,22 @@ cmdVolInfo(vshControl *ctl, const vshCmd *cmd)
if (virStorageVolGetInfo(vol, &info) == 0) {
double val;
const char *unit;
- vshPrint(ctl, "%-15s %s\n", _("Type:"),
- info.type == VIR_STORAGE_VOL_FILE ?
- _("file") : _("block"));
+ switch(info.type) {
+ case VIR_STORAGE_VOL_FILE:
+ vshPrint(ctl, "%-15s %s\n", _("Type:"), _("file"));
+ break;
+
+ case VIR_STORAGE_VOL_BLOCK:
+ vshPrint(ctl, "%-15s %s\n", _("Type:"), _("block"));
+ break;
+
+ case VIR_STORAGE_VOL_DIR:
+ vshPrint(ctl, "%-15s %s\n", _("Type:"), _("dir"));
+ break;
+
+ default:
+ vshPrint(ctl, "%-15s %s\n", _("Type:"), _("unknown"));
+ }
val = prettyCapacity(info.capacity, &unit);
vshPrint(ctl, "%-15s %2.2lf %s\n", _("Capacity:"), val, unit);
--
1.7.4.1
13 years, 1 month
[libvirt] [PATCH v2] pci address conflict when virtio disk with drive type
by Xu He Jie
When using the xml as below:
------------------------------------------------------
<devices>
<emulator>/home/soulxu/data/work-code/qemu-kvm/x86_64-softmmu/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/home/soulxu/data/VM/images/linux.img'/>
<target dev='vda' bus='virtio'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</memballoon>
</devices>
------------------------------------------------------
Then can't startup qemu, the error message as below:
virsh # start test-vm
error: Failed to start domain test-vm
error: internal error process exited while connecting to monitor: qemu-system-x86_64: -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3: PCI: slot 3 function 0 not available for virtio-balloon-pci, in use by virtio-blk-pci
qemu-system-x86_64: -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3: Device 'virtio-balloon-pci' could not be initialized
So adding check for bus type and address type. Only the address of pci type support by virtio bus.
Signed-off-by: Xu He Jie <xuhj(a)linux.vnet.ibm.com>
---
src/qemu/qemu_command.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 30c0be6..7c4bc0a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1321,13 +1321,17 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs)
/* Disks (VirtIO only for now */
for (i = 0; i < def->ndisks ; i++) {
- if (def->disks[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)
- continue;
-
/* Only VirtIO disks use PCI addrs */
if (def->disks[i]->bus != VIR_DOMAIN_DISK_BUS_VIRTIO)
continue;
+ if ((def->disks[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
+ (def->disks[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)) {
+ qemuReportError(VIR_ERR_INTERNAL_ERROR,
+ _("virtio only support device address type 'PCI' "));
+ goto error;
+ }
+
if (qemuDomainPCIAddressSetNextAddr(addrs, &def->disks[i]->info) < 0)
goto error;
}
--
1.7.4.1
13 years, 1 month
[libvirt] [PATCH V1 0/4] Support for multiple IP addresses using lists
by Stefan Berger
This patch series builds on the previously posted patch series
https://www.redhat.com/archives/libvir-list/2011-October/msg00912.html
and introduces the capability to assign a list to a variable and
have multiple rules instantiated, one for each item in the list.
This means, that if for example a variable like IP has been assigned
the following values
IP = [1.2.3.4, 5.6.7.8, 10.0.0.1]
it will generate 3 rules, which then in turn allows us to build filters
that can evaluate multiple possible values per field, i.e., allow
the filtering for multiple IP addresses (per interface).
It would then need David Steven's patch for support of 'RETURN' (and
'CONTINUE') target(s).
Regards,
Stefan
13 years, 1 month
[libvirt] [PATCH] virsh: Fix vol-info's 'Type' output
by Ryota Ozaki
We have a new type "dir" in addition to "file" and "block", but
virsh doen't know it. Fix it.
Additionally, the patch lets virsh output "unknown" if not matched
any of them.
---
tools/virsh.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 42f62d7..72344f0 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -9540,9 +9540,22 @@ cmdVolInfo(vshControl *ctl, const vshCmd *cmd)
if (virStorageVolGetInfo(vol, &info) == 0) {
double val;
const char *unit;
- vshPrint(ctl, "%-15s %s\n", _("Type:"),
- info.type == VIR_STORAGE_VOL_FILE ?
- _("file") : _("block"));
+ switch(info.type) {
+ case VIR_STORAGE_VOL_FILE:
+ vshPrint(ctl, "%-15s %s\n", _("Type:"), _("file"));
+ break;
+
+ case VIR_STORAGE_VOL_BLOCK:
+ vshPrint(ctl, "%-15s %s\n", _("Type:"), _("block"));
+ break;
+
+ case VIR_STORAGE_VOL_DIR:
+ vshPrint(ctl, "%-15s %s\n", _("Type:"), _("dir"));
+ break;
+
+ default:
+ vshPrint(ctl, "%-15s %s\n", _("Type:"), _("unknown"));
+ }
val = prettyCapacity(info.capacity, &unit);
vshPrint(ctl, "%-15s %2.2lf %s\n", _("Capacity:"), val, unit);
--
1.7.4.1
13 years, 1 month
[libvirt] [PATCH] docs: Document filesystem type='block' for LXC
by Ryota Ozaki
Commit 77791dc0e allows LXC to use a host block device as a guest
filesystem, but it isn't documented yet.
---
docs/formatdomain.html.in | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 95d33c0..dc6b152 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1196,7 +1196,9 @@
</dd>
<dt><code>type='block'</code></dt>
<dd>
- Currently unused.
+ A host block device to mount in the guest. The filesystem
+ format will be autodetected. Only used by LXC driver
+ <span class="since">(since 0.9.5)</span>.
</dd>
</dl>
--
1.7.4.1
13 years, 1 month
[libvirt] [PATCH 1/3] Add vapi bindings generation
by Marc-André Lureau
---
Makefile.am | 2 +-
configure.ac | 19 +++++++++++++++++++
vapi/Makefile.am | 37 +++++++++++++++++++++++++++++++++++++
vapi/libvirt-gobject-1.0.deps | 1 +
vapi/libvirt-gobject-1.0.metada | 2 ++
5 files changed, 60 insertions(+), 1 deletions(-)
create mode 100644 vapi/Makefile.am
create mode 100644 vapi/libvirt-gobject-1.0.deps
create mode 100644 vapi/libvirt-gobject-1.0.metada
diff --git a/Makefile.am b/Makefile.am
index 3df8626..8d082c0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
-SUBDIRS = libvirt-glib libvirt-gconfig libvirt-gobject python examples
+SUBDIRS = libvirt-glib libvirt-gconfig libvirt-gobject python vapi examples
ACLOCAL_AMFLAGS = -I m4
diff --git a/configure.ac b/configure.ac
index 0581874..c474f0b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -198,12 +198,31 @@ if test "x$enable_introspection" != "xno" ; then
fi
AM_CONDITIONAL([WITH_GOBJECT_INTROSPECTION], [test "x$enable_introspection" = "xyes"])
+AC_ARG_ENABLE([vala],
+ AS_HELP_STRING([--enable-vala], [enable Vala binding generation]),
+ [], [enable_vala=check])
+if test "x$enable_introspection" = "xyes" ; then
+ if test "x$enable_vala" != "xno" ; then
+ AC_PATH_PROG(VAPIGEN, vapigen, no)
+ if test "x$VAPIGEN" != "xno"; then
+ if test "x$enable_vala" == "xcheck" ; then
+ enable_vala=yes
+ AC_SUBST(VAPIGEN)
+ fi
+ else
+ AC_MSG_ERROR([Cannot find the "vapigen" binary in your PATH])
+ fi
+ fi
+fi
+AM_CONDITIONAL([WITH_VALA], [test "x$enable_vala" = "xyes"])
+
AC_OUTPUT(Makefile
libvirt-glib/Makefile
libvirt-gconfig/Makefile
libvirt-gobject/Makefile
examples/Makefile
python/Makefile
+ vapi/Makefile
libvirt-glib-1.0.pc
libvirt-gconfig-1.0.pc
libvirt-gobject-1.0.pc
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
new file mode 100644
index 0000000..f844576
--- /dev/null
+++ b/vapi/Makefile.am
@@ -0,0 +1,37 @@
+NULL =
+
+if WITH_VALA
+vapidir = $(datadir)/vala/vapi
+vapi_DATA = \
+ libvirt-gconfig-1.0.vapi \
+ libvirt-glib-1.0.vapi \
+ libvirt-gobject-1.0.vapi \
+ $(NULL)
+
+libvirt-glib-1.0.vapi: $(top_builddir)/libvirt-glib/LibvirtGLib-1.0.gir
+ $(AM_V_GEN)$(VAPIGEN) \
+ --vapidir=. \
+ --pkg gobject-2.0 \
+ --pkg gio-2.0 \
+ --library libvirt-glib-1.0 \
+ $<
+
+libvirt-gobject-1.0.vapi: $(top_builddir)/libvirt-gobject/LibvirtGObject-1.0.gir
+ $(AM_V_GEN)$(VAPIGEN) \
+ --vapidir=. \
+ --pkg gobject-2.0 \
+ --pkg gio-2.0 \
+ --pkg libvirt-glib-1.0 \
+ --library libvirt-gobject-1.0 \
+ $<
+
+libvirt-gconfig-1.0.vapi: $(top_builddir)/libvirt-gconfig/LibvirtGConfig-1.0.gir
+ $(AM_V_GEN)$(VAPIGEN) \
+ --vapidir=. \
+ --pkg gobject-2.0 \
+ --library libvirt-gconfig-1.0 \
+ $<
+
+endif
+
+CLEANFILES = $(vapi_DATA)
diff --git a/vapi/libvirt-gobject-1.0.deps b/vapi/libvirt-gobject-1.0.deps
new file mode 100644
index 0000000..899e8e8
--- /dev/null
+++ b/vapi/libvirt-gobject-1.0.deps
@@ -0,0 +1 @@
+libvirt-gconfig-1.0
diff --git a/vapi/libvirt-gobject-1.0.metada b/vapi/libvirt-gobject-1.0.metada
new file mode 100644
index 0000000..90e5197
--- /dev/null
+++ b/vapi/libvirt-gobject-1.0.metada
@@ -0,0 +1,2 @@
+init_object.argv unowned
+init_object_check.argv unowned
--
1.7.6.2
13 years, 1 month