[libvirt] [PATCH 0/8] Introduce new API virDomainUndefineFlags
by Osier Yang
Hi,
Per discussion on
https://www.redhat.com/archives/libvir-list/2011-July/msg00556.html,
This patch series introduce new API virDomainUndefineFlags, which
only support flag VIR_DOMAIN_UNDEFINE_MANAGED_STATE now, might introduce
more flags in future.
If the flag is specified, the domain managed state file will be removed
along with domain undefine process once it exists, the entire domain undefine
process will fail if it fails on removing the managed state file.
[PATCH 1/8] is small fix on rpc generator scripts, not related with the
new API.
[PATCH 1/8] Small fixes on rpc generator scripts
[PATCH 2/8] UndefineFlags: Define the public API
[PATCH 3/8] UndefineFlags: Implement the public API
[PATCH 4/8] UndefineFlags: Define the internal API
[PATCH 5/8] UndefineFlags: Implement qemu driver handling
[PATCH 6/8] UndefineFlags: Implement libxl driver handling
[PATCH 7/8] UndefineFlags: Implement the remote protocol
[PATCH 8/8] UndefineFlags: Extend virsh undefine to support new flag
Regards
Osier
13 years, 4 months
[libvirt] [PATCH] Fix reporting of cert validation failures
by Daniel P. Berrange
If the server succesfully validates the client cert, it will send
back a single byte, under TLS. If it fails, it will close the
connection. In this case, we were just reporting the standard
I/O error. The original RPC code had a special case hack for the
GNUTLS_E_UNEXPECTED_PACKET_LENGTH error code to make us report
a more useful error message
* src/rpc/virnetclient.c: Return ENOMSG if we get
GNUTLS_E_UNEXPECTED_PACKET_LENGTH
* src/rpc/virnettlscontext.c: Report cert failure if we
see ENOMSG
---
src/rpc/virnetclient.c | 2 +-
src/rpc/virnettlscontext.c | 3 +++
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index b9f0fc8..d3965c6 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -348,7 +348,7 @@ int virNetClientSetTLSSession(virNetClientPtr client,
ignore_value(pthread_sigmask(SIG_BLOCK, &oldmask, NULL));
len = virNetTLSSessionRead(client->tls, buf, 1);
- if (len < 0) {
+ if (len < 0 && errno != ENOMSG) {
virReportSystemError(errno, "%s",
_("Unable to read TLS confirmation"));
goto error;
diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c
index b778550..4963ab7 100644
--- a/src/rpc/virnettlscontext.c
+++ b/src/rpc/virnettlscontext.c
@@ -932,6 +932,9 @@ ssize_t virNetTLSSessionWrite(virNetTLSSessionPtr sess,
case GNUTLS_E_INTERRUPTED:
errno = EINTR;
break;
+ case GNUTLS_E_UNEXPECTED_PACKET_LENGTH:
+ errno = ENOMSG;
+ break;
default:
errno = EIO;
break;
--
1.7.4.4
13 years, 4 months
[libvirt] [PATCH] Unregister event callback if a fatal error occurs during dispatch
by Daniel P. Berrange
If we get an I/O error in the async event callback for an RPC
client, we might not have consumed all pending data off the
wire. This could result in the callback being immediately
invoked again. At which point the same I/O might occur. And
we're invoked again. And again...And again...
Unregistering the async event callback if an error occurs is
a good safety net. The real error will be seen when the next
RPC method is invoked
* src/rpc/virnetclient.c: Unregister event callback on error
---
src/rpc/virnetclient.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index 9fb8fd4..58d4274 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -1124,8 +1124,10 @@ void virNetClientIncomingEvent(virNetSocketPtr sock,
goto done;
}
- if (virNetClientIOHandleInput(client) < 0)
- VIR_DEBUG("Something went wrong during async message processing");
+ if (virNetClientIOHandleInput(client) < 0) {
+ VIR_WARN("Something went wrong during async message processing");
+ virNetSocketRemoveIOCallback(sock);
+ }
done:
virNetClientUnlock(client);
--
1.7.4.4
13 years, 4 months
[libvirt] [PATCH] Fix error message for missing TLS write function
by Daniel P. Berrange
* src/rpc/virnettlscontext.c: s/read/write/
---
src/rpc/virnettlscontext.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c
index 4963ab7..6a06565 100644
--- a/src/rpc/virnettlscontext.c
+++ b/src/rpc/virnettlscontext.c
@@ -803,7 +803,7 @@ virNetTLSSessionPush(void *opaque, const void *buf, size_t len)
{
virNetTLSSessionPtr sess = opaque;
if (!sess->writeFunc) {
- VIR_WARN("TLS session push with missing read function");
+ VIR_WARN("TLS session push with missing write function");
errno = EIO;
return -1;
};
--
1.7.4.4
13 years, 4 months
[libvirt] [PATCH] util: fix a typo error on virStrncpy
by ajia@redhat.com
* src/util/util.c: fix a typo error on virStrncpy.
---
src/util/util.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/util/util.c b/src/util/util.c
index 0ca81df..1080823 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -1754,7 +1754,7 @@ virStrncpy(char *dest, const char *src, size_t n, size_t destbytes)
return NULL;
ret = strncpy(dest, src, n);
- /* strncpy NULL terminates iff the last character is \0. Therefore
+ /* strncpy NULL terminates if the last character is \0. Therefore
* force the last byte to be \0
*/
dest[n] = '\0';
--
1.7.1
13 years, 4 months
[libvirt] [PATCH] build: fix VPATH build of todo
by Eric Blake
Without this patch, the make rule in a VPATH build was trying to
invoke ../../docs/../../docs/todo.pl, which didn't exist.
* docs/Makefile.am (todo.html.in): Using $< already implies
$(srcdir) in GNU make VPATH situations.
---
Pushing under the trivial rule.
docs/Makefile.am | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 050ebe1..7ff94a0 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -104,7 +104,7 @@ web: $(dot_html) html/index.html devhelp/index.html
todo.html.in: todo.pl
if [ -f todo.cfg ]; then \
echo "Generating $@"; \
- $(PERL) $(srcdir)/$< > $@ \
+ $(PERL) $< > $@ \
|| { rm $@ && exit 1; }; \
else \
echo "Stubbing $@"; \
--
1.7.4.4
13 years, 4 months
[libvirt] [PATCH RFC V2 00/10] support cpu bandwidth in libvirt
by Wen Congyang
TODO:
1. We create sub directory for each vcpu in cpu subsystem. So
we should recalculate cpu.shares for each vcpu.
Changelog:
v2: almost rewrite the patchset to support to control each vcpu's
bandwidth.
Limit quota to [-1, 2^64/1000] at the schemas level. We will
check it at cgroup level.
Wen Congyang (10):
Introduce the function virCgroupForVcpu
cgroup: Implement cpu.cfs_period_us and cpu.cfs_quota_us tuning API
Update XML Schema for new entries
qemu: Implement period and quota tunable XML configuration and
parsing.
support to pass VIR_DOMAIN_AFFECT_CURRENT to virDomainGetVcpusFlags()
vcpubandwidth: introduce two new libvirt APIs
vcpubandwidth: implement the code to support new API for the qemu
driver
vcpubandwidth: implement the remote protocol to address the new API
vcpubandwidth: Implement virsh support
doc: Add documentation for new cputune elements period and quota
daemon/remote.c | 132 +++++++
docs/formatdomain.html.in | 19 +
docs/schemas/domain.rng | 29 ++-
include/libvirt/libvirt.h.in | 41 +++-
python/generator.py | 2 +
src/conf/domain_conf.c | 272 ++++++++++++++-
src/conf/domain_conf.h | 17 +
src/driver.h | 14 +
src/libvirt.c | 129 +++++++-
src/libvirt_private.syms | 9 +
src/libvirt_public.syms | 6 +
src/qemu/qemu_cgroup.c | 131 +++++++
src/qemu/qemu_cgroup.h | 2 +
src/qemu/qemu_driver.c | 429 ++++++++++++++++++++++-
src/qemu/qemu_process.c | 4 +
src/remote/remote_driver.c | 64 ++++
src/remote/remote_protocol.x | 32 ++-
src/rpc/gendispatch.pl | 30 ++
src/util/cgroup.c | 153 ++++++++-
src/util/cgroup.h | 11 +
tests/qemuxml2argvdata/qemuxml2argv-cputune.xml | 2 +
tools/virsh.c | 142 ++++++++-
tools/virsh.pod | 16 +
23 files changed, 1658 insertions(+), 28 deletions(-)
13 years, 4 months