[libvirt] [PATCH v4 0/9] Implement Add/Del IOThreads
by John Ferlan
v3 here:
http://www.redhat.com/archives/libvir-list/2015-April/msg00621.html
Changes since v3
Patch 1:
* Add back in and use virDomainIOThreadIDDefFree
* Change _virDomainIOThreadIDDef 'undefined' to 'autofill'
* Adjust virDomainDefParseXML to only allocate what's defined
allowing virDomainDefPostParseInternal to Add in IOThreads
which weren't defined and set the 'autofill' boolean
* Have virDomainIOThreadIDAdd return a virDomainIOThreadIDDefPtr
Patch 2: No changes
Patch 3: (NEW)
* Discussed in prior review regarding making virDomainPinIsDuplicate
a static function (needed to move it)
Patch 4: (NEW)
* Move the iothreadspin data (e.g., the cpumask) into _virDomainIOThreadIDDef
* Kept the 'niothreadspin' and manipulated as necessary since there was code
to write out <cputune> data that I didn't want to reinvent/rototill just
to search through iothreadids for a cpumask
* Adjusted virDomainIOThreadPinDefParseXML to handle storing the cpumask
in the right iothreadsid[] entry. If not found (it may not be since the
virDomainDefPostParseInternal hasn't run), then create an autofill version
of an iothreadids entry.
* Remove/adjust a lot of code that used to handle iothreadspin
Patch 5: (NEW)
* Slight adjustment for iothreadsched to allow for "any" id value. This
code stores iothread id's as bitmap entries, so it didn't have the same
issues as the iothreadspin code
Patch 6-7: Unchanged
Patch 8:
* Adjusted the search for the new thread code to use existing alias
* Use the virDomainIOThreadIDAdd returned pointer
* Comment adjustments from code review
* Removal of erroneously cut-n-pasted code in Delete path
* Use the ->dst for the message
* Changes based on having cpumask in the iothrid data
Patch 9: No changes
John Ferlan (9):
conf: Add new domain XML element 'iothreadids'
qemu: Use domain iothreadids to IOThread's 'thread_id'
conf: Move virDomainPinIsDuplicate and make static
Move iothreadspin information into iothreadids
conf: Adjust the iothreadsched expectations
Implement virDomainAddIOThread and virDomainDelIOThread
remote: Add support for AddIOThread and DelIOThread
qemu: Add support to Add/Delete IOThreads
virsh: Add iothreadadd and iothreaddel commands
docs/formatdomain.html.in | 46 +-
docs/schemas/domaincommon.rng | 12 +
include/libvirt/libvirt-domain.h | 6 +
src/conf/domain_audit.c | 9 +
src/conf/domain_audit.h | 6 +
src/conf/domain_conf.c | 340 ++++++++++----
src/conf/domain_conf.h | 25 +-
src/driver-hypervisor.h | 12 +
src/libvirt-domain.c | 118 +++++
src/libvirt_private.syms | 6 +-
src/libvirt_public.syms | 6 +
src/qemu/qemu_cgroup.c | 31 +-
src/qemu/qemu_command.c | 38 +-
src/qemu/qemu_command.h | 3 +
src/qemu/qemu_domain.c | 36 --
src/qemu/qemu_domain.h | 3 -
src/qemu/qemu_driver.c | 511 ++++++++++++++++++---
src/qemu/qemu_process.c | 40 +-
src/remote/remote_driver.c | 2 +
src/remote/remote_protocol.x | 30 +-
src/remote_protocol-structs | 12 +
.../qemuxml2argv-cputune-iothreadsched-toomuch.xml | 1 +
.../qemuxml2argv-iothreads-ids-partial.args | 10 +
.../qemuxml2argv-iothreads-ids-partial.xml | 33 ++
.../qemuxml2argv-iothreads-ids.args | 8 +
.../qemuxml2argv-iothreads-ids.xml | 33 ++
tests/qemuxml2argvtest.c | 2 +
tests/qemuxml2xmltest.c | 2 +
tools/virsh-domain.c | 164 +++++++
tools/virsh.pod | 31 ++
30 files changed, 1320 insertions(+), 256 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-ids-partial.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-ids-partial.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-ids.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-iothreads-ids.xml
--
2.1.0
9 years, 7 months
[libvirt] [PATCH] build: avoid obsolete index()
by Eric Blake
Commit 2a530a3e5 is not portable to mingw, which intentionally
avoids declaring the obsolete index(). See also:
https://bugzilla.redhat.com/show_bug.cgi?id=1214605
* src/util/virstring.c (virStringStripControlChars): Use strchr.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule.
src/util/virstring.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/util/virstring.c b/src/util/virstring.c
index 1cd4987..7b0cad7 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2014 Red Hat, Inc.
+ * Copyright (C) 2012-2015 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -1003,7 +1003,7 @@ virStringStripControlChars(char *str)
len = strlen(str);
for (i = 0, j = 0; i < len; i++) {
- if (index(control_chars, str[i]))
+ if (strchr(control_chars, str[i]))
continue;
str[j++] = str[i];
--
2.1.0
9 years, 7 months
[libvirt] [PATCH] parallels: implement .domainGetMaxMemory
by Dmitry Guryanov
Since we haven't implemented balloon parameters tuning
we can just return amount of memory in this function.
Signed-off-by: Dmitry Guryanov <dguryanov(a)parallels.com>
---
src/parallels/parallels_driver.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c
index 391e927..d13a4e2 100644
--- a/src/parallels/parallels_driver.c
+++ b/src/parallels/parallels_driver.c
@@ -1089,6 +1089,24 @@ parallelsDomainManagedSaveRemove(virDomainPtr domain, unsigned int flags)
return ret;
}
+static unsigned long long
+parallelsDomainGetMaxMemory(virDomainPtr domain)
+{
+ parallelsConnPtr privconn = domain->conn->privateData;
+ virDomainObjPtr dom = NULL;
+ int ret = -1;
+
+ dom = virDomainObjListFindByUUID(privconn->domains, domain->uuid);
+ if (dom == NULL) {
+ parallelsDomNotFoundError(domain);
+ return -1;
+ }
+
+ ret = dom->def->mem.max_balloon;
+ virObjectUnlock(dom);
+ return ret;
+}
+
static virHypervisorDriver parallelsDriver = {
.name = "Parallels",
.connectOpen = parallelsConnectOpen, /* 0.10.0 */
@@ -1133,6 +1151,7 @@ static virHypervisorDriver parallelsDriver = {
.domainHasManagedSaveImage = parallelsDomainHasManagedSaveImage, /* 1.2.13 */
.domainManagedSave = parallelsDomainManagedSave, /* 1.2.14 */
.domainManagedSaveRemove = parallelsDomainManagedSaveRemove, /* 1.2.14 */
+ .domainGetMaxMemory = parallelsDomainGetMaxMemory, /* 1.2.14 */
};
static virConnectDriver parallelsConnectDriver = {
--
2.1.0
9 years, 7 months
[libvirt] [PATCH 0/4] Introduce parallelsDomObjFromDomain()
by Michal Privoznik
We have such wrapper in other drivers too: qemu, lxc, network, ...
Michal Privoznik (4):
struct _parallelsConn: Mark @domains as immutable pointer
parallels: Introduce parallelsDomObjFromDomain()
parallels_driver: Utilize parallelsDomObjFromDomain()
parallels_sdk: Utilize parallelsDomObjFromDomain()
src/parallels/parallels_driver.c | 93 ++++++----------------------------------
src/parallels/parallels_sdk.c | 5 +--
src/parallels/parallels_utils.c | 32 ++++++++++++++
src/parallels/parallels_utils.h | 5 +++
4 files changed, 51 insertions(+), 84 deletions(-)
--
2.0.5
9 years, 7 months
[libvirt] [PATCH] qemu: lock: unlock vm during qemuBuildCommandLine
by zhang bo
The function qemuBuildCommandLine() may take a long time, for example
if we configure tens of vifs for the guest, each may cost hundrands of
milliseconds to create tap dev, senconds in total. Thus, unlock vm
before calling it.
Signed-off-by: Zhang Bo <oscar.zhangbo(a)huawei.com>
Signed-off-by: Zhou Yimin <zhouyimin(a)huawei.com>
---
src/qemu/qemu_process.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 753afe8..d1aaaec 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4628,14 +4628,18 @@ int qemuProcessStart(virConnectPtr conn,
}
VIR_DEBUG("Building emulator command line");
+ virObjectUnlock(vm);
if (!(cmd = qemuBuildCommandLine(conn, driver, vm->def, priv->monConfig,
priv->monJSON, priv->qemuCaps,
migrateFrom, stdin_fd, snapshot, vmop,
&buildCommandLineCallbacks, false,
qemuCheckFips(),
priv->autoNodeset,
- &nnicindexes, &nicindexes)))
+ &nnicindexes, &nicindexes))) {
+ virObjectLock(vm);
goto cleanup;
+ }
+ virObjectLock(vm);
/* now that we know it is about to start call the hook if present */
if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
--
1.7.12.4
9 years, 7 months
[libvirt] [RFCv2 PoCv1 PATCH 00/15] Just Admin API
by Martin Kletzander
*** BLURB ***
...
Just kidding :)
Sooo... After very very VERY long time, here's a draft of an admin
interface that is supposed to open up new possibilities to be done on
a live daemon. The aim here is to create some first inches of that
API in order to open up the possibility of new API function creation
to more people.
I already spent so much time explaining so much of that that I don't
know what else to point at in here. Maybe the fact that last three
patches are just an example on how this might work. Of course there
won't be any functions like listClientIDs with the need of getting
each client info by another API. There's going to be
e.g. virAdmClientInfo and virAdmGetClients() will return the list of
them, etc. Long story short, let's not repeat past mistakes ;)
With all that said, feel free to hate, love, comment or just try out
compiling this series and let me know how many things I've missed and
screwed up (hopefully zero).
Martin Kletzander (15):
util: add virJSONValueCopy
util: Add virabstracts file for keeping abstract classes
datatypes: Use abstract connect class in virConnect
Break virNetServer into virNetSubServers
Teach gendispatch how to handle admin dispatching files
Add admin protocol
Build client headers for admin protocol
Add admin error domain
Add libvirt-admin library
Add XML files with admin API specification
Add configuration options for permissions on daemon's admin socket
Add support for admin API in libvirt daemon
rpc: Add virNetSubServerGetNClients
admin: Add virAdmHello function
Example virt-admin
.gitignore | 5 +
Makefile.am | 4 +-
cfg.mk | 11 +-
configure.ac | 19 +-
daemon/Makefile.am | 33 +-
daemon/admin_server.c | 119 +++++
daemon/admin_server.h | 36 ++
daemon/libvirtd-config.c | 5 +-
daemon/libvirtd-config.h | 1 +
daemon/libvirtd.aug | 1 +
daemon/libvirtd.c | 138 ++++--
daemon/libvirtd.conf | 8 +
daemon/libvirtd.h | 14 +-
daemon/remote.c | 194 ++++-----
daemon/test_libvirtd.aug.in | 1 +
docs/Makefile.am | 23 +-
docs/apibuild.py | 10 +-
include/libvirt/Makefile.am | 6 +-
include/libvirt/libvirt-admin.h | 63 +++
include/libvirt/virterror.h | 3 +-
libvirt-admin.pc.in | 13 +
libvirt.spec.in | 10 +
po/POTFILES.in | 3 +
src/Makefile.am | 134 +++++-
src/admin/admin_protocol.x | 73 ++++
src/admin_protocol-structs | 17 +
src/datatypes.c | 39 +-
src/datatypes.h | 45 +-
src/internal.h | 1 +
src/libvirt-admin.c | 363 ++++++++++++++++
src/libvirt-host.c | 3 +-
src/libvirt_admin.syms | 19 +
src/libvirt_private.syms | 6 +
src/libvirt_remote.syms | 17 +-
src/locking/lock_daemon.c | 40 +-
src/locking/lock_daemon_dispatch.c | 18 +-
src/lxc/lxc_controller.c | 18 +-
src/rpc/gendispatch.pl | 141 +++---
src/rpc/virnetserver.c | 859 +++++++++++++------------------------
src/rpc/virnetserver.h | 61 +--
src/rpc/virnetserverprogram.c | 12 +-
src/rpc/virnetserverprogram.h | 9 +-
src/rpc/virnetsubserver.c | 672 +++++++++++++++++++++++++++++
src/rpc/virnetsubserver.h | 78 ++++
src/util/virabstracts.c | 100 +++++
src/util/virabstracts.h | 57 +++
src/util/virerror.c | 95 ++--
src/util/virerror.h | 4 +-
src/util/virjson.c | 65 ++-
src/util/virjson.h | 4 +-
tests/confdata/libvirtd.conf | 6 +
tests/confdata/libvirtd.out | 5 +
tests/jsontest.c | 111 +++++
tools/virt-admin/Makefile.am | 70 +++
tools/virt-admin/virt-admin.c | 68 +++
tools/virt-admin/virt-admin.pod | 43 ++
56 files changed, 3092 insertions(+), 881 deletions(-)
create mode 100644 daemon/admin_server.c
create mode 100644 daemon/admin_server.h
create mode 100644 include/libvirt/libvirt-admin.h
create mode 100644 libvirt-admin.pc.in
create mode 100644 src/admin/admin_protocol.x
create mode 100644 src/admin_protocol-structs
create mode 100644 src/libvirt-admin.c
create mode 100644 src/libvirt_admin.syms
create mode 100644 src/rpc/virnetsubserver.c
create mode 100644 src/rpc/virnetsubserver.h
create mode 100644 src/util/virabstracts.c
create mode 100644 src/util/virabstracts.h
create mode 100644 tools/virt-admin/Makefile.am
create mode 100644 tools/virt-admin/virt-admin.c
create mode 100644 tools/virt-admin/virt-admin.pod
--
2.3.5
9 years, 7 months
[libvirt] [PATCH] rng: fix port number range validation
by Daniel P. Berrange
The PortNumber data type is declared to derive from 'short'.
Unfortunately this is an signed type, so validates the range
[-32,768, 32,767] which excludes valid port numbers between
32767 and 65535.
We can't use 'unsignedShort', since we need -1 to be a valid
port number too.
This change is to use 'int' and set an explicit max boundary
instead of relying on the data types' built-in max.
One of the existing tests is changed to use a high port number
to validate the schema.
https://bugzilla.redhat.com/show_bug.cgi?id=1214664
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
docs/schemas/basictypes.rng | 3 ++-
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index f086ad2..a83063a 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -349,8 +349,9 @@
</define>
<define name="PortNumber">
- <data type="short">
+ <data type="int">
<param name="minInclusive">-1</param>
+ <param name="maxInclusive">65535</param>
</data>
</define>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.args
index 1b61fcf..34dc767 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.args
@@ -1,4 +1,4 @@
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
/usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor unix:/tmp/test-monitor,server,nowait \
-no-acpi -boot c -usb -hda /dev/HostVG/QEMUGuest1 \
--net none -serial none -parallel none -vnc 127.0.0.1:0,share=allow-exclusive
+-net none -serial none -parallel none -vnc 127.0.0.1:59630,share=allow-exclusive
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml
index f78ff48..4b88e49 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml
@@ -25,7 +25,7 @@
<controller type='pci' index='0' model='pci-root'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='5900' autoport='no' listen='127.0.0.1' sharePolicy='allow-exclusive'>
+ <graphics type='vnc' port='65530' autoport='no' listen='127.0.0.1' sharePolicy='allow-exclusive'>
<listen type='address' address='127.0.0.1'/>
</graphics>
<video>
--
2.1.0
9 years, 7 months
[libvirt] [PATCH 0/2] Apparmor PCI passthrough fixes
by Cédric Bosdonnat
Hi all,
These two simple patches intend to fix apparmor profiles for PCI passthrough
with the qemu driver.
Cédric Bosdonnat (2):
Allow access to vendor and device file for PCI device passthrough
Apparmor: allow reading block-rbd.so
examples/apparmor/libvirt-qemu | 1 +
src/util/virpci.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
--
2.1.4
9 years, 7 months
[libvirt] [PATCH] util: string: Avoid use of deprecated function index()
by Peter Krempa
---
src/util/virstring.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/util/virstring.c b/src/util/virstring.c
index 1cd4987..e48c29a 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -976,6 +976,21 @@ static const char control_chars[] =
"\x10\x11\x12\x13\x14\x15\x16\x17"
"\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
+
+static bool
+virStringIsControlChar(char c)
+{
+ const char *cch;
+
+ for (cch = control_chars; *cch; cch++) {
+ if (*cch == c)
+ return true;
+ }
+
+ return false;
+}
+
+
bool
virStringHasControlChars(const char *str)
{
@@ -1003,7 +1018,7 @@ virStringStripControlChars(char *str)
len = strlen(str);
for (i = 0, j = 0; i < len; i++) {
- if (index(control_chars, str[i]))
+ if (virStringIsControlChar(str[i]))
continue;
str[j++] = str[i];
--
2.3.5
9 years, 7 months