[libvirt] [PATCH 0/2] Fix a virperf related crasher
by Michal Privoznik
I've ran into a crasher. Worse crasher over RO connection.
Michal Privoznik (2):
Drop virPerfGetEventFd
virPerfEventIsEnabled: Don't crash on shut off domains
src/libvirt_private.syms | 1 -
src/util/virperf.c | 22 +++-------------------
src/util/virperf.h | 3 ---
3 files changed, 3 insertions(+), 23 deletions(-)
--
2.8.3
8 years, 5 months
[libvirt] Plan for the next release
by Daniel Veillard
I will be travelling end of this week and most of next week, but
I think we can still try to get a release for June 1st, I suggest:
- enter freeze this Thrusday 26
- Push an rc2 over the week-end
- try to push the 1.3.5 release on Wed June 1st
I hope this works for everybody !
Thanks,
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
8 years, 5 months
[libvirt] [PATCH v3] virDomainChrGetDomainPtrsInternal: Return an integer
by Michal Privoznik
There's this problem on the recent gcc-6.1:
In file included from conf/domain_conf.c:37:0:
conf/domain_conf.c: In function 'virDomainChrPreAlloc':
conf/domain_conf.c:14109:35: error: potential null pointer dereference [-Werror=null-dereference]
return VIR_REALLOC_N(*arrPtr, *cntPtr + 1);
^~
./util/viralloc.h:158:73: note: in definition of macro 'VIR_REALLOC_N'
# define VIR_REALLOC_N(ptr, count) virReallocN(&(ptr), sizeof(*(ptr)), (count), \
^~~~~
conf/domain_conf.c: In function 'virDomainChrRemove':
conf/domain_conf.c:14133:21: error: potential null pointer dereference [-Werror=null-dereference]
for (i = 0; i < *cntPtr; i++) {
^~~~~~~
GCC basically fails to see, that the
virDomainChrGetDomainPtrsInternal will never actually return NULL
because it's never called over a domain char device with _LAST
type. But to make it shut up, lets turn this function into
returning an integer and check in the callers if a zero value
value was returned.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
diff to v2:
- Yet another improvement as suggested in review of v2
src/conf/domain_conf.c | 39 +++++++++++++++++++++++----------------
1 file changed, 23 insertions(+), 16 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 7d46d0b..9f9fdf2 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14038,7 +14038,7 @@ virDomainChrFind(virDomainDefPtr def,
/* Return the address within vmdef to be modified when working with a
* chrdefptr of the given type. */
-static void
+static int ATTRIBUTE_RETURN_CHECK
virDomainChrGetDomainPtrsInternal(virDomainDefPtr vmdef,
virDomainChrDeviceType type,
virDomainChrDefPtr ***arrPtr,
@@ -14048,28 +14048,30 @@ virDomainChrGetDomainPtrsInternal(virDomainDefPtr vmdef,
case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL:
*arrPtr = &vmdef->parallels;
*cntPtr = &vmdef->nparallels;
- break;
+ return 0;
case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL:
*arrPtr = &vmdef->serials;
*cntPtr = &vmdef->nserials;
- break;
+ return 0;
case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
*arrPtr = &vmdef->consoles;
*cntPtr = &vmdef->nconsoles;
- break;
+ return 0;
case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL:
*arrPtr = &vmdef->channels;
*cntPtr = &vmdef->nchannels;
- break;
+ return 0;
case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST:
- *arrPtr = NULL;
- *cntPtr = NULL;
break;
}
+
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown char device type: %d"), type);
+ return -1;
}
@@ -14085,14 +14087,13 @@ virDomainChrGetDomainPtrs(const virDomainDef *vmdef,
size_t *cntVar = NULL;
/* Cast away const; we add it back in the final assignment. */
- virDomainChrGetDomainPtrsInternal((virDomainDefPtr) vmdef, type,
- &arrVar, &cntVar);
- if (arrVar) {
+ if (virDomainChrGetDomainPtrsInternal((virDomainDefPtr) vmdef, type,
+ &arrVar, &cntVar) < 0) {
+ *arrPtr = NULL;
+ *cntPtr = 0;
+ } else {
*arrPtr = (const virDomainChrDef **) *arrVar;
*cntPtr = *cntVar;
- } else {
- *arrPtr = NULL;
- *cntPtr = 0;
}
}
@@ -14104,7 +14105,9 @@ virDomainChrPreAlloc(virDomainDefPtr vmdef,
virDomainChrDefPtr **arrPtr = NULL;
size_t *cntPtr = NULL;
- virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType, &arrPtr, &cntPtr);
+ if (virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType,
+ &arrPtr, &cntPtr) < 0)
+ return -1;
return VIR_REALLOC_N(*arrPtr, *cntPtr + 1);
}
@@ -14116,7 +14119,9 @@ virDomainChrInsertPreAlloced(virDomainDefPtr vmdef,
virDomainChrDefPtr **arrPtr = NULL;
size_t *cntPtr = NULL;
- virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType, &arrPtr, &cntPtr);
+ if (virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType,
+ &arrPtr, &cntPtr) < 0)
+ return;
VIR_APPEND_ELEMENT_INPLACE(*arrPtr, *cntPtr, chr);
}
@@ -14128,7 +14133,9 @@ virDomainChrRemove(virDomainDefPtr vmdef,
virDomainChrDefPtr ret = NULL, **arrPtr = NULL;
size_t i, *cntPtr = NULL;
- virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType, &arrPtr, &cntPtr);
+ if (virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType,
+ &arrPtr, &cntPtr) < 0)
+ return NULL;
for (i = 0; i < *cntPtr; i++) {
ret = (*arrPtr)[i];
--
2.8.3
8 years, 5 months
[libvirt] [PATCH 00/10] vz: improve locking in getting domain statistics
by Nikolay Shirokovskiy
Current stats cache uses same lock as domain cache, namely lock
of virDomainObjPtr. First this is not necessary, domain cache is
used to translate id of object of interest from libvirt to vzsdk
one. Besides this domain object is not used. Second this is risky
game as lock is dropped on waiting for stat events from sdk deep
down on stack so callers throughout the stack should be written
very carefully.
This patch series makes stats cache self locking and thus making
code much more solid. This is done thru introducing extra lock for
stats cache. Statistics API functions first use domain cache then
drop domain lock, query stats cache and unreference domain object.
Patches 1-4 conform API functions to this structure. Patches 5-7
makes subsidiary improvments. Patch 8 finally introduce new lock.
Last patches are cleanup[9] and bugfix[10].
Nikolay Shirokovskiy (10):
vz: pass string instead of disk definition to block stat function
vz: prepare disks names before getting all disks stats
vz: move getting stats in vzDomainGetVcpus to the end
vz: move getting stats in vzDomainGetInfo to the end
vz: use consistent naming for different domain object in vz_driver.c
vz: simplify refcount on sdkdom in prlsdkLoadDomain
vz: hold stats cache in a pointer in vzDomObj
vz: introduce stats cache lock
vz: extract on stats cache update into a function
vz: fix many stat request issue
src/vz/vz_driver.c | 397 +++++++++++++++++++++++++++++++++++------------------
src/vz/vz_sdk.c | 230 +++++++++++++++++++++----------
src/vz/vz_sdk.h | 15 +-
src/vz/vz_utils.c | 9 --
src/vz/vz_utils.h | 6 +-
5 files changed, 438 insertions(+), 219 deletions(-)
--
1.8.3.1
8 years, 5 months
[libvirt] libvirt-tck test failure after commit b3d06987
by Jim Fehlig
We've noticed libvirt-tck test 100-apply-verify-host.t failing recently on
libvirt.git master and I finally got around to bisecting it to commit b3d06987.
I haven't looked at the test in detail, but it appears to expect a broadcast
address of 10.1.2.255, however finds an address of 0.0.0.0 after commit
b3d06987. I'm not terribly familiar with this code, but the following hunk of
b3d06987 looks suspect
@@ -1039,21 +1039,28 @@ virNetDevCreateNetlinkAddressMessage(int messageType,
const char *ifname,
virSocketAddr *addr,
unsigned int prefix,
- virSocketAddr *broadcast)
+ virSocketAddr *broadcast,
+ virSocketAddr *peer)
{
struct nl_msg *nlmsg = NULL;
struct ifaddrmsg ifa;
unsigned int ifindex;
void *addrData = NULL;
+ void *peerData = NULL;
void *broadcastData = NULL;
size_t addrDataLen;
if (virNetDevGetIPAddressBinary(addr, &addrData, &addrDataLen) < 0)
return NULL;
- if (broadcast && virNetDevGetIPAddressBinary(broadcast, &broadcastData,
- &addrDataLen) < 0)
- return NULL;
+ if (peer && VIR_SOCKET_ADDR_VALID(peer)) {
+ if (virNetDevGetIPAddressBinary(peer, &peerData, &addrDataLen) < 0)
+ return NULL;
+ } else if (broadcast) {
+ if (virNetDevGetIPAddressBinary(broadcast, &broadcastData,
+ &addrDataLen) < 0)
+ return NULL;
+ }
/* Get the interface index */
if ((ifindex = if_nametoindex(ifname)) == 0)
Vasiliy, I can look in more detail tomorrow, but in the meantime any suggestions
you have would be much appreciated.
Regards,
Jim
8 years, 5 months
[libvirt] [PATCH v2 0/4] Final round of build fixes
by Michal Privoznik
diff to v1:
- Some patches from the original patch set are pushed now
- For the other ones, I've managed to work in review suggestions
Michal Privoznik (4):
virNetDevBridgeGet: Don't require users to virNetDevSetupControl
ppc64Compute: Avoid possible NULL dereference
virDomainChrGetDomainPtrsInternal: Return an integer
virDomainFormatSchedDef: Avoid false positive NULL dereference
src/conf/domain_conf.c | 44 ++++++++++++++++++++++++++++++--------------
src/cpu/cpu_ppc64.c | 12 ++++++------
src/util/virnetdevbridge.c | 35 ++++++++++++-----------------------
3 files changed, 48 insertions(+), 43 deletions(-)
--
2.8.3
8 years, 5 months
[libvirt] Python listDefinedDomains broken?
by Marc Richter
Hi everyone,
please, don't roast me if I'm asking stupid things or fail to provide
info, since I'm a freshman, using libvirt.
I have two servers, both running the following versions:
Compiled against library: libvirt 1.3.1
Using library: libvirt 1.3.1
Using API: QEMU 1.3.1
Running hypervisor: QEMU 0.14.0
I'm trying to create a Python program, which gets a list of all defined
domains for each host and give a list for domains only defined on one of
these hosts. This Python script is running on a third host (my
workstation), using these versions:
Python: 3.5.1
libvirt-python: 1.3.1
When I'm running virsh on my workstation (version 1.3.1), like this:
virsh -c
"qemu+ssh://root@host1/system?keyfile=/home/user/.ssh/id_rsa_libvirt"
--readonly list --all
Then a domain named "winxp_ausgeschaltet" is within that list:
Id Name State
----------------------------------------------------
...
- winxp_ausgeschaltet shut off
When I do the same for the second host, it is also in that list:
Id Name State
----------------------------------------------------
...
7 winxp_ausgeschaltet running
When I do the following in Python, this domain is listed for the first
host (where it's state is "shut off"), but not for the second one:
import libvirt
import sys
class kvmhost:
def __init__(self, host, keyfile):
self.conn = self.connect_kvm(host, keyfile)
self.doms = sorted(self.get_doms())
def connect_kvm(self, host, keyfile):
try:
conn = libvirt.openReadOnly('qemu+ssh://root@' + host +
'/system?keyfile=' + keyfile)
except libvirt.libvirtError as lve:
print('Error: ' + str(lve))
sys.exit(1)
return conn
def get_doms(self):
try:
alldoms = self.conn.listDefinedDomains()
except libvirt.libvirtError as lve:
print('Error: ' + str(lve))
self.conn.close()
sys.exit(1)
return alldoms
host1 = kvmhost('host1', '/path/to/ssh_keyfile')
host2 = kvmhost('host2', '/path/to/ssh_keyfile')
print(host1.doms)
print(host2.doms)
What am I doing wrong here or: is there a missbehavior in libvirt or the
python module?
Using listAllDomains instead of listDefinedDomains gives:
libvirt: Remote Driver error : unknown procedure: 273
What is the difference between listAllDomains and listDefinedDomains at all?
Thanks for your help.
Marc
8 years, 5 months
[libvirt] [PATCH v2 0/2] qemu: expand domain memory statistics
by Derbyshev Dmitriy
From: Derbyshev Dmitry <dderbyshev(a)virtuozzo.com>
QEMU reports timestamp and available along with other memory statistics.
This information was not saved into domain statistics.
Changes since v1:
* Enum numeration fixed
* Macro getting "usage" field fixed
Derbyshev Dmitry (2):
qemu: expand domain memory statistics with 'usable'
qemu: expand domain memory statistics with 'last-update' timestamp
include/libvirt/libvirt-domain.h | 11 ++++++++++-
src/libvirt-domain.c | 5 +++++
src/qemu/qemu_monitor_json.c | 23 +++++++++++++----------
tools/virsh-domain-monitor.c | 4 ++++
4 files changed, 32 insertions(+), 11 deletions(-)
--
1.9.5.msysgit.0
8 years, 5 months
[libvirt] [PATCH 0/4] Move secret object command line building helpers
by John Ferlan
More "extractable" changes from my work on adding luks support.
While working through changes in storage_backend.c I found that the
building of the 'qemu-img' command to create a luks volume will need
to create a secret object.
In order to do that I found if I took the qemu_command code and moved
things around a bit, then I would be able to access the API's that I
need. Moving the command line building from qemu_command.c to virjson.c
seemed logical since it was multipurpose/generic anyway. I'm not "tied"
to the API name chosen - if there's suggestions, I'll adjust. Then splitting
out the generation of the secret object props into their own API and then
eventually into secret_util.c seemed to be the best avenue. I can then
include secret_util into the storage driver.
The last change just cleans up the secinfo command building processing.
It was "complicated" when there was going to be hostdev and disk code
trying to generate the same objects... Now that just seems less important.
When/if iSCSI/hostdev support for the AES secret is added, I'll made the
appropriate adjustments then.
John Ferlan (4):
qemu: Move and rename qemuBuildObjectCommandlineFromJSON
qemu: Introduce qemuBuildSecretObjectProps
qemu: Move and rename qemuBuildSecretObjectProps
qemu: Rework secinfo command line building
src/libvirt_private.syms | 4 +-
src/qemu/qemu_command.c | 199 ++++++--------------------------------------
src/qemu/qemu_command.h | 4 -
src/secret/secret_util.c | 59 +++++++++++++
src/secret/secret_util.h | 10 +++
src/util/virjson.c | 117 +++++++++++++++++++++++++-
src/util/virjson.h | 12 ++-
tests/qemucommandutiltest.c | 7 +-
8 files changed, 219 insertions(+), 193 deletions(-)
--
2.5.5
8 years, 5 months
[libvirt] KVM Forum 2016: Call For Participation
by Paolo Bonzini
=================================================================
KVM Forum 2016: Call For Participation
August 24-26, 2016 - Westin Harbor Castle - Toronto, Canada
(All submissions must be received before midnight May 1, 2016)
=================================================================
KVM Forum is an annual event that presents a rare opportunity
for developers and users to meet, discuss the state of Linux
virtualization technology, and plan for the challenges ahead.
We invite you to lead part of the discussion by submitting a speaking
proposal for KVM Forum 2016.
At this highly technical conference, developers driving innovation
in the KVM virtualization stack (Linux, KVM, QEMU, libvirt) can
meet users who depend on KVM as part of their offerings, or to
power their data centers and clouds.
KVM Forum will include sessions on the state of the KVM
virtualization stack, planning for the future, and many
opportunities for attendees to collaborate. As we celebrate ten years
of KVM development in the Linux kernel, KVM continues to be a
critical part of the FOSS cloud infrastructure.
This year, KVM Forum is joining LinuxCon and ContainerCon in Toronto,
Canada. Selected talks from KVM Forum will be presented on Wednesday
August 24 to the full audience of LinuxCon and ContainerCon. Also,
attendees of KVM Forum will have access to all of the LinuxCon and
ContainerCon talks on Wednesday.
http://events.linuxfoundation.org/cfp
Suggested topics:
KVM and Linux
* Scaling and optimizations
* Nested virtualization
* Linux kernel performance improvements
* Resource management (CPU, I/O, memory)
* Hardening and security
* VFIO: SR-IOV, GPU, platform device assignment
* Architecture ports
QEMU
* Management interfaces: QOM and QMP
* New devices, new boards, new architectures
* Scaling and optimizations
* Desktop virtualization and SPICE
* Virtual GPU
* virtio and vhost, including non-Linux or non-virtualized uses
* Hardening and security
* New storage features
* Live migration and fault tolerance
* High availability and continuous backup
* Real-time guest support
* Emulation and TCG
* Firmware: ACPI, UEFI, coreboot, u-Boot, etc.
* Testing
Management and infrastructure
* Managing KVM: Libvirt, OpenStack, oVirt, etc.
* Storage: glusterfs, Ceph, etc.
* Software defined networking: Open vSwitch, OpenDaylight, etc.
* Network Function Virtualization
* Security
* Provisioning
* Performance tuning
===============
SUBMITTING YOUR PROPOSAL
===============
Abstracts due: May 1, 2016
Please submit a short abstract (~150 words) describing your presentation
proposal. Slots vary in length up to 45 minutes. Also include the proposal
type -- one of:
- technical talk
- end-user talk
Submit your proposal here:
http://events.linuxfoundation.org/cfp
Please only use the categories "presentation" and "panel discussion"
You will receive a notification whether or not your presentation proposal
was accepted by May 27, 2016.
Speakers will receive a complimentary pass for the event. In the instance
that your submission has multiple presenters, only the primary speaker for a
proposal will receive a complementary event pass. For panel discussions, all
panelists will receive a complimentary event pass.
TECHNICAL TALKS
A good technical talk should not just report on what has happened over
the last year; it should present a concrete problem and how it impacts
the user and/or developer community. Whenever applicable, focus on
work that needs to be done, difficulties that haven't yet been solved,
and on decisions that other developers should be aware of. Summarizing
recent developments is okay but it should not be more than a small
portion of the overall talk.
END-USER TALKS
One of the big challenges as developers is to know what, where and how
people actually use our software. We will reserve a few slots for end
users talking about their deployment challenges and achievements.
If you are using KVM in production you are encouraged submit a speaking
proposal. Simply mark it as an end-user talk. As an end user, this is a
unique opportunity to get your input to developers.
HANDS-ON / BOF SESSIONS
We will reserve some time for people to get together and discuss
strategic decisions as well as other topics that are best solved within
smaller groups.
These sessions will be announced during the event. If you are interested
in organizing such a session, please add it to the list at
http://www.linux-kvm.org/page/KVM_Forum_2016_BOF
Let people you think might be interested know about it, and encourage
them to add their names to the wiki page as well. Please try to
add your ideas to the list before KVM Forum starts.
PANEL DISCUSSIONS
If you are proposing a panel discussion, please make sure that you list
all of your potential panelists in your abstract. We will request full
biographies if a panel is accepted.
===============
HOTEL / TRAVEL
===============
This year's event will take place at the Westin Harbour Castle Toronto.
For information on discounted room rates for conference attendees
and on other hotels close to the conference, please visit
http://events.linuxfoundation.org/events/kvm-forum/attend/hotel-travel.
As of March 15, 2016, non-US citizens need either a visa or an Electronic
Travel Authorization (eTA) in order to enter Canada. Detailed information
on the travel documentation required for your country of origin can
be found at http://www.cic.gc.ca/english/visit/visas.asp and
http://events.linuxfoundation.org/events/kvm-forum/attend/hotel-travel.
** We urge you to start this process as quickly as possible to ensure
** receipt of appropriate travel documentation in time for your conference
** travel to Canada. For processing times for visa applications, please visit
** http://www.cic.gc.ca/english/information/times/.
===============
IMPORTANT DATES
===============
Notification: May 27, 2015
Schedule announced: June 3, 2015
Event dates: August 24-26, 2016
Thank you for your interest in KVM. We're looking forward to your
submissions and seeing you at the KVM Forum 2016 in August!
-your KVM Forum 2016 Program Committee
Please contact us with any questions or comments at
kvm-forum-2016-pc(a)redhat.com
8 years, 5 months