[libvirt] [PATCH] qemu: Provide a much clearer message on device hot-plug
by Erik Skultety
Adjust the current message to make it clear, that it is the hot-plug
operation that is unsupported with the given host device type.
https://bugzilla.redhat.com/show_bug.cgi?id=1450072
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 4ca10863c..1b8504b13 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -2674,7 +2674,7 @@ qemuDomainAttachHostDevice(virConnectPtr conn,
{
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("hostdev mode '%s' not supported"),
+ _("hot-plug is not supported for hostdev mode '%s'"),
virDomainHostdevModeTypeToString(hostdev->mode));
return -1;
}
@@ -2705,7 +2705,8 @@ qemuDomainAttachHostDevice(virConnectPtr conn,
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("hostdev subsys type '%s' not supported"),
+ _("hot-plug is not supported for hostdev subsys type "
+ "'%s'"),
virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
goto error;
}
@@ -4820,7 +4821,8 @@ qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
break;
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("hostdev subsys type '%s' not supported"),
+ _("hot-unplug is not supported for hostdev subsys type "
+ "'%s'"),
virDomainHostdevSubsysTypeToString(detach->source.subsys.type));
return -1;
}
@@ -4852,7 +4854,7 @@ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("hostdev mode '%s' not supported"),
+ _("hot-unplug is not supported for hostdev mode '%s'"),
virDomainHostdevModeTypeToString(hostdev->mode));
return -1;
}
--
2.12.2
7 years, 6 months
[libvirt] ANNOUNCE: libvirt 2.2.1 maintenance release
by Cole Robinson
libvirt 2.2.1 is now available. This is a maintenance release of
libvirt 2.2 with additional bugfixes that have accumulated
upstream since the initial release.
This release can be downloaded at:
http://libvirt.org/sources/stable_updates/libvirt-2.2.1.tar.xz
Changes in this version:
* spec: Avoid RPM verification errors on nwfilter XMLs
* qemu_process: spice: don't release used port
* qemu: Fix crash during qemuStateCleanup
* daemon: Fix crash during daemon cleanup
* Fix crash on usb-serial hotplug
* qemuBuildMemoryBackendStr: Don't crash if no hugetlbfs is mounted
* util: fix crash in virClassIsDerivedFrom for CloseCallbacks objects
* storage: driver: Remove unavailable transient pools after restart
* storage: driver: Split out code fixing pool state after deactivation
* qemu: Don't assume secret provided for LUKS encryption
* conf: do not steal pointers from the pool source
* schema: do not require name for certain pool types
* virtlogd: Don't stop or restart along with libvirtd
* virtlogd.socket: Tie lifecycle to libvirtd.service
* spec: Update version check for maint Source URL
* qemu: capabilities: Don't partially reprope caps on process reconnect
* network: fix endless loop when starting network with multiple IPs and no
dhcp
* qemu: allow 32 slots on pcie-expander-bus, not just 1
* qemu: Only use memory-backend-file with NUMA if needed
For info about past maintenance releases, see:
http://wiki.libvirt.org/page/Maintenance_Releases
Thanks,
Cole
7 years, 6 months
[libvirt] ANNOUNCE: libvirt 3.2.1 maintenance release
by Cole Robinson
libvirt 3.2.1 is now available. This is a maintenance release of
libvirt 3.2 with additional bugfixes that have accumulated
upstream since the initial release.
This release can be downloaded at:
http://libvirt.org/sources/stable_updates/libvirt-3.2.1.tar.xz
Changes in this version:
* spec: Update version check for maint Source URL
* mdev: Cleanup code after commits @daf5081b and @2739a983
* Don't use ceph-devel on Fedora
* mdev: Fix mingw build by adding a check for non-NULL pointer
* client: Report proper close reason
* qemu: Fix persistent migration of transient domains
* Fix padding of encrypted data
* network: better log message when network is inactive during reconnect
* qemu: don't kill qemu process on restart if networkNotify fails
* conf: format only relevant attributes for graphics based on listen type
* qemu: Move freeing of PCI address list to qemuProcessStop
* qemu: process: Clean up priv->migTLSAlias
* qemu: process: Don't leak priv->usbaddrs after VM restart
* qemu: process: Clean automatic NUMA/cpu pinning information on shutdown
* qemu: Remove extra messages for vhost-scsi hotplug
* qemu: Remove extra messages from virtio-scsi hotplug
* qemu: Check return code from qemuHostdevPrepareSCSIDevices
* qemu: numa: Don't return automatic nodeset for inactive domain
* qemu: Ignore missing query-migrate-parameters
* daemon: Fix domain name leak in error path
* qemu: fix argument of virDomainNetGetActualDirectMode
* rpc: fix keep alive timer segfault
* util: allow ignoring SIOCSIFHWADDR when errno is EPERM
* util: check ifa_addr pointer before accessing its elements
* Increase default task limit for libvirtd
* Fix error reporting when poll returns POLLHUP/POLLERR
* spec: Avoid RPM verification errors on nwfilter XMLs
* xenconfig: avoid double free on OOM testing
* xenFormatXLDomainDisks: avoid double free on OOM testing
* virConfSaveValue: protect against a NULL pointer reference
* conf: Add check for non scsi_host parent during vport delete
* util: Fix resource leak
* test: Remove unused variate @maxcpu in testDomainGetVcpus
* esx: Fix memory leak
* esx: Fix incorrect memory compare size in esxStoragePoolLookupByUUID
* qemu: snapshot: Skip empty drives with internal snapshots
* qemu: do not crash on USB address with no port and invalid bus
* man: Align vol-resize arguments with the output of help
* qemu: conf: Don't leak snapshot image format conf variable
* qemu: Fix mdev checking for VFIO support
* util: systemd: Don't strlen a possibly NULL string
* interface: Fix resource leak in netcfConnectListAllInterfaces error path
* virsh: don't leak @cpumap in virshVcpuPinQuery
* tests: fix some resource leaks
* rpc: fix resource leak
* src: fix multiple resource leaks in loops
* conf/domain_capabilities: fix resource leak
* qemu: Fix two use-after-free situations
* disk: Force usage of parted when checking disk format for "bsd"
* disk: Resolve issues with disk partition build/start checks
* conf: create new RemovalFailed event using correct class
* qemu: fix memory leak and check mdevPath
* qemu: Properly reset TLS in qemuProcessRecoverMigrationIn
* Properly ignore files in build-aux directory
* conf: Fix possible memleak in capabilities
* Split out -Wframe-larger-than warning from WARN_CLFAGS
* virISCSIGetSession: Don't leak memory
* virStorageSourceClear: Don't leave dangling pointers behind
* qemu: Break endless loop if qemuMigrationResetTLS fails
* storage: gluster: Implement 'checkPool' method so that state is restored
* docs: Document limitation of maximum vcpu count used with <topology>
* qemu: Fix resource leak in qemuDomainAddChardevTLSObjects error path
* qemu: Initialize 'data' argument
* storage: util: Pass pool type to virStorageBackendFindGlusterPoolSources
* util: ignore -Wcast-align in virNetlinkDumpCommand
* qemu: hotplug: Clear vcpu ordering for coldplug of vcpus
* qemu: hotplug: Fix formatting strings in
qemuDomainFilterHotplugVcpuEntities
* qemu: hotplug: Iterate over vcpu 0 in individual vcpu hotplug code
* qemu: Add device id for mediated devices on qemu command line
* storage: Fix capacity value for LUKS encrypted volumes
* virNetDevIPCheckIPv6ForwardingCallback fixes
* storage: driver: Remove unavailable transient pools after restart
* storage: driver: Split out code fixing pool state after deactivation
* storage: backend: Use correct stringifier for pool type
* mdev: Fix daemon crash on domain shutdown after reconnect
* util: mdev: Use a local variable instead of a direct pointer access
* qemu: Fix regression when hyperv/vendor_id feature is used
* vz: fix typo that breaks build
For info about past maintenance releases, see:
http://wiki.libvirt.org/page/Maintenance_Releases
Thanks,
Cole
7 years, 6 months
[libvirt] [PATCH] tests: stub out virfilewrapper.c on Win32
by Daniel P. Berrange
The Win32 platform can not do link time overrides in the same way
that we can on POSIX / ELF based platforms, so we cannot build
the virfilewrapper.c code reliably. Just stub it out on Win32
so it is a no-op. Tests that use this file are already written
to skip on Win32.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
Pushed as a mingw build fix
tests/virfilewrapper.c | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/tests/virfilewrapper.c b/tests/virfilewrapper.c
index 5ea70b3..bf2fa69 100644
--- a/tests/virfilewrapper.c
+++ b/tests/virfilewrapper.c
@@ -18,15 +18,17 @@
#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
+#ifndef WIN32
-#include "viralloc.h"
-#include "virfile.h"
-#include "virfilewrapper.h"
-#include "virmock.h"
-#include "virstring.h"
+# include <stdio.h>
+# include <stdlib.h>
+# include <fcntl.h>
+
+# include "viralloc.h"
+# include "virfile.h"
+# include "virfilewrapper.h"
+# include "virmock.h"
+# include "virstring.h"
/* Mapping for prefix overrides */
@@ -139,7 +141,7 @@ virFileWrapperOverridePrefix(const char *path)
}
-#define PATH_OVERRIDE(newpath, path) \
+# define PATH_OVERRIDE(newpath, path) \
do { \
init_syms(); \
\
@@ -177,7 +179,7 @@ int access(const char *path, int mode)
return ret;
}
-#ifdef HAVE___LXSTAT
+# ifdef HAVE___LXSTAT
int __lxstat(int ver, const char *path, struct stat *sb)
{
int ret = -1;
@@ -191,7 +193,7 @@ int __lxstat(int ver, const char *path, struct stat *sb)
return ret;
}
-#endif /* HAVE___LXSTAT */
+# endif /* HAVE___LXSTAT */
int lstat(const char *path, struct stat *sb)
{
@@ -207,7 +209,7 @@ int lstat(const char *path, struct stat *sb)
return ret;
}
-#ifdef HAVE___XSTAT
+# ifdef HAVE___XSTAT
int __xstat(int ver, const char *path, struct stat *sb)
{
int ret = -1;
@@ -221,7 +223,7 @@ int __xstat(int ver, const char *path, struct stat *sb)
return ret;
}
-#endif /* HAVE___XSTAT */
+# endif /* HAVE___XSTAT */
int stat(const char *path, struct stat *sb)
{
@@ -278,3 +280,4 @@ DIR *opendir(const char *path)
return ret;
}
+#endif
--
2.9.3
7 years, 6 months
[libvirt] [PATCH] rpc: improve error message for bounds check
by Daniel P. Berrange
If we exceed a fixed limit in RPC code we get a horrible message
like this, if the parameter type is a 'string', because we forgot
to initialize the error message type field:
$ virsh snapshot-list ostack1
error: too many remote undefineds: 1329 > 1024
It would also be useful to know which RPC call and field was
exceeded. So this patch makes us report:
$ virsh snapshot-list ostack1
error: too many remote undefineds: 1329 > 1024,
in parameter 'names' for 'virDomainSnapshotListNames'
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/rpc/gendispatch.pl | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index 173189c..0c5e4ba 100755
--- a/src/rpc/gendispatch.pl
+++ b/src/rpc/gendispatch.pl
@@ -1501,6 +1501,7 @@ elsif ($mode eq "client") {
$single_ret_list_name = $1;
$single_ret_list_max_var = "max$1";
$single_ret_list_max_define = $2;
+ $single_ret_list_error_msg_type = "string";
} elsif ($ret_member =~ m/^(admin|remote)_nonnull_string (\S+)<\S+>;/) {
# error out on unannotated arrays
die "$1_nonnull_string array without insert@<offset> annotation: $ret_member";
@@ -1773,7 +1774,8 @@ elsif ($mode eq "client") {
print "\n";
print " if ($single_ret_list_max_var > $single_ret_list_max_define) {\n";
print " virReportError(VIR_ERR_RPC,\n";
- print " _(\"too many remote ${single_ret_list_error_msg_type}s: %d > %d\"),\n";
+ print " _(\"too many remote ${single_ret_list_error_msg_type}s: %d > %d,\"\n";
+ print " \"in parameter '$single_ret_list_name' for 'vir$call->{ProcName}'\"),\n";
print " $single_ret_list_max_var, $single_ret_list_max_define);\n";
print " goto done;\n";
print " }\n";
@@ -1839,7 +1841,8 @@ elsif ($mode eq "client") {
$modern_ret_as_list) {
print " if (ret.$single_ret_list_name.${single_ret_list_name}_len > $single_ret_list_max_var) {\n";
print " virReportError(VIR_ERR_RPC,\n";
- print " _(\"too many remote ${single_ret_list_error_msg_type}s: %d > %d\"),\n";
+ print " _(\"too many remote ${single_ret_list_error_msg_type}s: %d > %d,\"\n";
+ print " \"in parameter '$single_ret_list_name' for 'vir$call->{ProcName}'\"),\n";
print " ret.$single_ret_list_name.${single_ret_list_name}_len, $single_ret_list_max_var);\n";
print " goto cleanup;\n";
print " }\n";
--
2.9.3
7 years, 6 months
[libvirt] [PATCH] remote: increase max storage pools, nwfilters & snapshots to 16384
by Daniel P. Berrange
Most other top level objects have already had their limits increased
to 16384. Increase the storage pool, nwfilter & snapshot object
limits to match. For snapshots at least, we have seen hosts which
exceeded the current limit
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/remote/remote_protocol.x | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 87b2bd3..4e3fa60 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -80,7 +80,7 @@ const REMOTE_NETWORK_LIST_MAX = 16384;
const REMOTE_INTERFACE_LIST_MAX = 16384;
/* Upper limit on lists of storage pools. */
-const REMOTE_STORAGE_POOL_LIST_MAX = 4096;
+const REMOTE_STORAGE_POOL_LIST_MAX = 16384;
/* Upper limit on lists of storage vols. */
const REMOTE_STORAGE_VOL_LIST_MAX = 16384;
@@ -92,7 +92,7 @@ const REMOTE_NODE_DEVICE_LIST_MAX = 65536;
const REMOTE_NODE_DEVICE_CAPS_LIST_MAX = 65536;
/* Upper limit on lists of network filters. */
-const REMOTE_NWFILTER_LIST_MAX = 1024;
+const REMOTE_NWFILTER_LIST_MAX = 16384;
/* Upper limit on list of scheduler parameters. */
const REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX = 16;
@@ -137,7 +137,7 @@ const REMOTE_AUTH_TYPE_LIST_MAX = 20;
const REMOTE_DOMAIN_MEMORY_STATS_MAX = 1024;
/* Upper limit on lists of domain snapshots. */
-const REMOTE_DOMAIN_SNAPSHOT_LIST_MAX = 1024;
+const REMOTE_DOMAIN_SNAPSHOT_LIST_MAX = 16384;
/* Maximum length of a block peek buffer message.
* Note applications need to be aware of this limit and issue multiple
--
2.9.3
7 years, 6 months
[libvirt] [RFE] Raise enumeration limit for virDomain-{ListAllSnapshots, SnapshotListNames}?
by Kashyap Chamarthy
I've got a server with multiple guests, and wanted to quickly check how
many of them had snapshots (and in turn, how many snapshots).
So I quickly wrote the below script to enumerate the snapshots using the
virDomainSnapshotListNames() API, and it turned out, one of the guests
had 1329 snaphots (created by a script for testing):
libvirt.libvirtError: too many remote undefineds: 1329 > 1024
DanPB on IRC said we could likely raise that limit:
"we can likely increase that limit, since the rpc message size would
allow many more before the ultimate limit is hit"
He also points out the error message could be improved and is a sign of
a bug:
"'undefined' is a perl NULL that must come from a bug in the rpc
generator"
* * *
Script I used to test:
[ Version: libvirt-daemon-kvm-3.2.0-1.fc25.x86_64 ]
-----------------------------------------------------------------------
#!/usr/bin/python
import libvirt
import sys
conn = libvirt.openReadOnly('qemu:///system')
if conn == None:
print 'Failed to open connection to the hypervisor'
sys.exit(1)
domains = conn.listAllDomains(0)
for name in domains:
try:
dom = conn.lookupByName(name.name())
except libvirt.libvirtError:
print "Domain %s not found" % name
sys.exit(1)
print("Name: %s, ID: %d, OSType: %s" % (name.name(), dom.ID(),
dom.OSType()))
# print(dom.listAllSnapshots())
print(dom.snapshotListNames())
-----------------------------------------------------------------------
Executing the above script throws (since the 'ostack1' guest apparently
had 1329 snapshots):
[...]
Name: cirros, ID: -1, OSType: hvm
[]
Name: compute, ID: -1, OSType: hvm
[]
Name: ostack1, ID: -1, OSType: hvm
Traceback (most recent call last):
File "enumerate-snapshots.py", line 23, in <module>
print(dom.snapshotListNames())
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 2527, in snapshotListNames
if ret is None: raise libvirtError ('virDomainSnapshotListNames() failed', dom=self)
libvirt.libvirtError: too many remote undefineds: 1329 > 1024
[...]
--
/kashyap
7 years, 6 months
[libvirt] CLI management tool
by Michal Privoznik
Dear list,
you might have seen a discussion about virsh, and adding some new
features to it [1]. While the feature was rejected, it got me thinking.
What options do we offer for sysadmins that:
a) want to stay in command line
b) want higher level mgmt of their domains
c) yet want to manage a single host
Basically, virsh is just too low level for some operations (and using it
in non-interactive mode from a script can mean hundreds of connections).
Then we have virt-manager, which suits b) and c), but it's not a CLI
tool. Therefore I was thinking whether we should start a new project on
the top of libvirt that would fit all three points.
Personally, I've never been a sysadmin, so perhaps I am not the best one
to write the tool. But I'm open for suggestions.
What do you think?
Michal
1: https://www.redhat.com/archives/libvir-list/2017-May/msg00051.html
7 years, 6 months