[libvirt] the arguments of qemudDispatchServerEvent
by mzawdx wang
Hi all:
I am now reading the source codes of libvirt with version 0.9.2 ,
and be stuck by the function "qemudDispatchServerEvent". as you can see:
static void
qemudDispatchServerEvent(int watch, int fd, int events, void *opaque) {
...
}
My question is : except for the argument "void *opaque", when and how the
other three arguments (int watch, int fd, int events) being incoming ?
For it is a static function, I look through the source file "libvirt.c" and
find no answer .
Could someone give me a help ?
Thanks a lot.
Yours.
mzawdx
12 years, 3 months
[libvirt] Schedule for next release: entering freeze in a week
by Daniel Veillard
I would rather have the release a bit earlier than expected,
I was initially hoping to get a new set of localization for
Sep 4 but it is clear at this point that we won't have them
in time. Since we have been working on 0.10.0 for 6 weeks now,
I think pushing it 2 weeks from now is reasonnable, so I
suggest to enter the freeze next week on Wed 22 for a release
on the 29 Aug (or a bit earlier if things go well).
Considering the amount of changes done for 0.10.0, (we are already
at 370 patches in) my guess is that an extra release at the end
of September not too long after 0.10.0 but with enough testing
feedack will make maintainance easier. So I'm shooting for
a 0.10.1 release aproximately 4 weeks after 0.10.0 itself,
If such a schedule is raising problem, please tell :-)
And if you have patches you want in 0.10.0 which didn't got reviews
or isn't pushed, please git rebase them and send them again
so they get the attention needed and get pushed within a
week !
thanks,
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] stateless drivers and stored lists of virDomainObjs
by Dmitry Guryanov
Hello,
vmware, openvz and parallels driver, which was written with first two ones
as an example, get list of domains in virConnectOpen and then use it for
lookups and even for listing sometimes. This is not correct, because you
can make several connections to the same driver and changes, made in one
connection will not be visible to other. And you can also create or
destroy domains using native tools.
So I think keeping list of domains in a stateless driver is a bad idea -
you should update this list each time when user requests some info. It's
better to retrieve needed data only when it requested, like in xenapi
driver.
I asked this because I want to continue developing parallels driver and it'=
s
not so hard to change it now, so it should be fixed before adding any new
code there. Maybe vmware and openvz drivers should be also fixed.
--
Dmitry Guryanov
12 years, 3 months
[libvirt] [PATCH 1/3] parallels: change URI to parallels:///system
by Dmitry Guryanov
Let's change URI to parallels:///system. Parallels Server supports
creating VMs from non-privileged accounts, but it's not main usage
scenario and it may be forbidden in the future.
Also containers, which will be supported by the driver, can be managed
only by root, so /system path is more suitable for this driver.
Signed-off-by: Dmitry Guryanov <dguryanov(a)parallels.com>
---
docs/drvparallels.html.in | 10 +++++-----
src/parallels/parallels_driver.c | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/docs/drvparallels.html.in b/docs/drvparallels.html.in
index 40a0fe5..8e1430b 100644
--- a/docs/drvparallels.html.in
+++ b/docs/drvparallels.html.in
@@ -19,10 +19,10 @@
The libvirt Parallels driver is a single-instance privileged driver, with a driver name of 'parallels'. Some example connection URIs for the libvirt driver are:
</p>
<pre>
-parallels:///default (local access)
-parallels+unix:///default (local access)
-parallels://example.com/default (remote access, TLS/x509)
-parallels+tcp://example.com/default (remote access, SASl/Kerberos)
-parallels+ssh://root@example.com/default (remote access, SSH tunnelled)
+parallels:///system (local access)
+parallels+unix:///system (local access)
+parallels://example.com/system (remote access, TLS/x509)
+parallels+tcp://example.com/system (remote access, SASl/Kerberos)
+parallels+ssh://root@example.com/system (remote access, SSH tunnelled)
</pre>
</body></html>
diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c
index 05db54f..53b5a50 100644
--- a/src/parallels/parallels_driver.c
+++ b/src/parallels/parallels_driver.c
@@ -670,11 +670,11 @@ parallelsOpen(virConnectPtr conn,
(conn->uri->path[0] == '/' && conn->uri->path[1] == '\0')) {
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("parallelsOpen: supply a path or use "
- "parallels:///session"));
+ "parallels:///system"));
return VIR_DRV_OPEN_ERROR;
}
- if (STREQ(conn->uri->path, "/session"))
+ if (STREQ(conn->uri->path, "/system"))
ret = parallelsOpenDefault(conn);
else
return VIR_DRV_OPEN_DECLINED;
--
1.7.1
12 years, 3 months
[libvirt] [PATCH] Update documentation for CPU quota/period support for LXC
by Sukadev Bhattiprolu
From: Sukadev Bhattiprolu <sukadev(a)linux.vnet.ibm.com>
Date: Tue, 14 Aug 2012 17:09:11 -0700
Subject: [PATCH] Update documentation for CPU quota/period support for LXC
Following commit added suport the CPU quota/period to the LXC driver.
Update the documentation to reflect that.
commit d9724a81b3c53a40f45bf76067a976cce73ed278
Author: Daniel P. Berrange <berrange(a)redhat.com>
Date: Thu Nov 10 12:16:26 2011 +0000
Add support for CPU quota/period to LXC driver
Signed-off-by: Sukadev Bhattiprolu <sukadev(a)linux.vnet.ibm.com>
---
docs/formatdomain.html.in | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index ec160bd..fb25cb8 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -426,8 +426,9 @@
interval(unit: microseconds). Within <code>period</code>, each vcpu of
the domain will not be allowed to consume more than <code>quota</code>
worth of runtime. The value should be in range [1000, 1000000]. A period
- with value 0 means no value. (NB: Only qemu driver support)
- <span class="since">Since 0.9.4</span>
+ with value 0 means no value.
+ <span class="since">Only QEMU driver support since 0.9.4, LXC since
+ 0.9.10</span>
</dd>
<dt><code>quota</code></dt>
<dd>
@@ -437,8 +438,9 @@
means that it is not bandwidth controlled. The value should be in range
[1000, 18446744073709551] or less than 0. A quota with value 0 means no
value. You can use this feature to ensure that all vcpus run at the same
- speed. (NB: Only qemu driver support)
- <span class="since">Since 0.9.4</span>
+ speed.
+ <span class="since">Only QEMU driver support since 0.9.4, LXC since
+ 0.9.10</span>
</dd>
</dl>
--
1.7.1
12 years, 3 months
[libvirt] [PATCH 00/48 v3] Atomic APIs to list objects
by Osier Yang
v2 - v3:
* Various document fixes/improvements (Suggested by Laine and Eric)
* Destroy virdomainlist.[ch], and folder all list helper funcs
into its own *_conf.[ch]
* Improve the helpers to get the object list. See
https://www.redhat.com/archives/libvir-list/2012-July/msg01267.html
* Rebased on top of commit 3df9626 by Peter and the virReportError
series by Daniel.
* Rebased on top of virsh split series. (I'm luck there is no
change on those commands since v2).
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.
Osier Yang (48):
Avoid strcase check for virsh-*.c
Destroy virdomainlist.[ch]
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
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
cfg.mk | 5 +-
daemon/remote.c | 382 ++++++++++++++++++++++
include/libvirt/libvirt.h.in | 101 ++++++-
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 | 125 ++++----
src/conf/domain_conf.c | 189 +++++++++++-
src/conf/domain_conf.h | 56 ++++
src/conf/network_conf.c | 91 ++++++
src/conf/network_conf.h | 22 ++
src/conf/node_device_conf.c | 103 ++++++
src/conf/node_device_conf.h | 16 +
src/conf/storage_conf.c | 116 +++++++
src/conf/storage_conf.h | 35 ++
src/conf/virdomainlist.c | 222 -------------
src/conf/virdomainlist.h | 84 -----
src/driver.h | 35 ++-
src/interface/netcf_driver.c | 135 ++++++++
src/libvirt.c | 487 ++++++++++++++++++++++++++++-
src/libvirt_private.syms | 4 +
src/libvirt_public.syms | 7 +
src/libxl/libxl_driver.c | 3 +-
src/lxc/lxc_driver.c | 3 +-
src/network/bridge_driver.c | 17 +
src/node_device/node_device_driver.c | 15 +
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 | 56 ++++
src/openvz/openvz_driver.c | 3 +-
src/parallels/parallels_driver.c | 3 +-
src/qemu/qemu_driver.c | 3 +-
src/remote/remote_driver.c | 449 ++++++++++++++++++++++++++
src/remote/remote_protocol.x | 80 +++++-
src/remote_protocol-structs | 85 +++++
src/secret/secret_driver.c | 59 ++++-
src/storage/storage_driver.c | 85 +++++
src/test/test_driver.c | 104 ++++++-
src/uml/uml_driver.c | 3 +-
src/vbox/vbox_tmpl.c | 9 +-
src/vmware/vmware_driver.c | 3 +-
tools/virsh-domain-monitor.c | 16 +-
tools/virsh-domain.c | 19 +-
tools/virsh-host.c | 2 +-
tools/virsh-interface.c | 259 +++++++++++-----
tools/virsh-network.c | 351 ++++++++++++++++-----
tools/virsh-nodedev.c | 302 ++++++++++++++++---
tools/virsh-nwfilter.c | 163 ++++++++--
tools/virsh-pool.c | 441 ++++++++++++++++++++------
tools/virsh-secret.c | 182 +++++++++--
tools/virsh-volume.c | 197 +++++++++---
tools/virsh.c | 58 +++-
tools/virsh.pod | 51 +++-
56 files changed, 4849 insertions(+), 867 deletions(-)
create mode 100644 python/libvirt-override-virStoragePool.py
delete mode 100644 src/conf/virdomainlist.c
delete mode 100644 src/conf/virdomainlist.h
--
1.7.7.3
12 years, 3 months
[libvirt] Seamless spice-migration on hosts with multiple interfaces
by Tiziano Müller
Hi everyone
I have a setup in which the VM-nodes have different interfaces for
migration (internal network) and public/spice access (public network).
Now, when I try to migrate a VM with a connected spice client, the
client always gets disconnected instead of seamlessly migrated.
The problem is that libvirt passes the spice client the hostname
according to the IP of the target interface of the migration instead of
the public interface (this has been confirmed using the spicy client
which displays an error during migration saying that it can't find the
new host "<internal hostname>").
What I tried:
* setting spice_listen in /etc/libvirt/qemu.conf
* defining a network in libvirt for the public network and using a
network in the listen-option for spice in the VMs XML
But the problem persists and the client still gets the internal
(migration) address instead of the public where spice is listening on.
This is with libvirt 0.9.13. Has anyone seen this behaviour before?
I tried to track down this problem and I'm not sure whether I find one
bug already, but the following code didn't look right. So I tried to fix
it (but the problem was still present):
--- src/qemu/qemu_migration.c.orig 2012-07-20 16:46:59.669855341 +0200
+++ src/qemu/qemu_migration.c 2012-07-20 16:47:58.637546032 +0200
@@ -1036,7 +1036,7 @@
if (ret == 0) {
ret = qemuMonitorGraphicsRelocate(priv->mon,
cookie->graphics->type,
- cookie->remoteHostname,
+ cookie->graphics->listen,
cookie->graphics->port,
cookie->graphics->tlsPort,
cookie->graphics->tlsSubject);
Thanks in advance,
Tiziano
12 years, 3 months
[libvirt] [PATCHv2 0/5] network: report #connections in network xml
by Laine Stump
This repost of an unreviewed patchset from last week is purely to
rebase - the "openvswitch in <network> 9 patch series is a
prerequisite of this, and this is a prerequisite of the vlan patch
series resend coming up.
These are all fairly short and simple, so shouldn't require too much
hair pulling to review :-)
=====
The forward devices in direct mode (aka macvtap) networks already have
a counter to keep track of how many guest interfaces are using each
physical device. This series renames that counter to "connections",
then adds another connects counter to the toplevel of each network,
and outputs both of these counters (when non-0) with the live XML for
the network (i.e. it isn't output if you ask for the --inactive xml).
Someone working on a management application had requested this info,
and it already existed, so I thought I may as well expose it.
12 years, 3 months
[libvirt] [PATCH] conf: log error when encountering multiple filterrefs in interface
by Laine Stump
Each interface has a single pointer to a filterref object. That
filterref can itself point to multiple other filterrefs, but at the
toplevel there is only one.
The parser had previously just silently overwritten earlier filterrefs
when a new one was encountered, so the interface was left with
whichever was the last filterref in the xml, ignoring all the
others. This patch logs an error when it sees more than one filterref.
---
src/conf/domain_conf.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ae95d81..58c424f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4627,6 +4627,12 @@ virDomainNetDefParseXML(virCapsPtr caps,
ioeventfd = virXMLPropString(cur, "ioeventfd");
event_idx = virXMLPropString(cur, "event_idx");
} else if (xmlStrEqual (cur->name, BAD_CAST "filterref")) {
+ if (filter) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("Invalid specification of multiple <filterref>s "
+ "in a single <interface>"));
+ goto error;
+ }
filter = virXMLPropString(cur, "filter");
virNWFilterHashTableFree(filterparams);
filterparams = virNWFilterParseParamAttributes(cur);
--
1.7.11.2
12 years, 3 months
[libvirt] [PATCH] Allow sticky bit to be read and set.
by Ján Tomko
---
src/conf/storage_conf.c | 8 +++++---
src/storage/storage_backend.c | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 3132aae..017648d 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -667,7 +667,8 @@ virStorageDefParsePerms(xmlXPathContextPtr ctxt,
} else {
int tmp;
- if (virStrToLong_i(mode, NULL, 8, &tmp) < 0 || (tmp & ~0777)) {
+ if (virStrToLong_i(mode, NULL, 8, &tmp) < 0 ||
+ (tmp & ~(S_ISVTX | S_IRWXUGO))) {
VIR_FREE(mode);
virReportError(VIR_ERR_XML_ERROR,
"%s", _("malformed octal mode"));
@@ -1037,7 +1038,7 @@ virStoragePoolDefFormat(virStoragePoolDefPtr def) {
virBufferAddLit(&buf," <permissions>\n");
virBufferAsprintf(&buf," <mode>0%o</mode>\n",
- def->target.perms.mode);
+ def->target.perms.mode & (S_ISVTX | S_IRWXUGO));
virBufferAsprintf(&buf," <owner>%d</owner>\n",
(int) def->target.perms.uid);
virBufferAsprintf(&buf," <group>%d</group>\n",
@@ -1290,7 +1291,8 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
virBufferAddLit(buf," <permissions>\n");
virBufferAsprintf(buf," <mode>0%o</mode>\n",
- def->perms.mode);
+ def->perms.mode &
+ (S_ISVTX | S_IRWXUGO));
virBufferAsprintf(buf," <owner>%u</owner>\n",
(unsigned int) def->perms.uid);
virBufferAsprintf(buf," <group>%u</group>\n",
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index df3833a..5fd14ed 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -1210,7 +1210,7 @@ virStorageBackendUpdateVolTargetInfoFD(virStorageVolTargetPtr target,
}
}
- target->perms.mode = sb.st_mode & S_IRWXUGO;
+ target->perms.mode = sb.st_mode & (S_ISVTX | S_IRWXUGO);
target->perms.uid = sb.st_uid;
target->perms.gid = sb.st_gid;
--
1.7.8.6
12 years, 3 months