[libvirt] <interface type='direct'>
by Moshe Levi
Hi,
In OpenStack we have a port type macvtap.
Mavtap port is just a tap device connected to VF.
In Libvirt the guest xml look like
<interface type='direct'>
<mac address='fa:16:3e:b1:06:4e'/>
<source dev='p1p6' mode='passthrough'/>
<target dev='macvtap1'/>
<model type='virtio'/>
<driver name='vhost'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
In the hypervisor we can see that the mac of the VF which is fa:16:3e:f3:9b:e8 - is set by OpenStack see [1]
9: ens3f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master ovs-system state UP mode DEFAULT group default qlen 1000
link/ether 7c:fe:90:29:24:4e brd ff:ff:ff:ff:ff:ff
vf 0 MAC 00:00:00:00:00:00, spoof checking off, link-state disable
vf 1 MAC 00:00:00:00:00:00, spoof checking off, link-state disable
vf 2 MAC fa:16:3e:f3:9b:e8, vlan 48, spoof checking on, link-state enable
vf 3 MAC fa:16:3e:f6:02:c8, vlan 48, spoof checking on, link-state enable
41: ens3f4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether fa:16:3e:f6:02:c8 brd ff:ff:ff:ff:ff:ff
42: macvtap0@ens3f4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 500
link/ether fa:16:3e:f6:02:c8, brd ff:ff:ff:ff:ff:ff
The netdevice of the VF which is ens3f4 has also the same mac. This mac is set when using Libvirt 1.2.2 (Ubuntu 14.04),
But when we tested with new Libvirt versions >= 1.2.17 (Fedora 23/Ubuntu 16.04) the mac netdevice of the VF (ens3f4) is not set.
This change in Libvirt breaks the guest from getting DHCP in OpenStack.
Do you know why the behavior change in newer releases?
We have a WIP patch in OpenStack for setting also the mac for the netdevice of the VF [2]. Just wanted to know that this is the correct approach.
[1] - https://github.com/openstack/nova/blob/master/nova/virt/libvirt/vif.py#L6...
[2] - https://review.openstack.org/#/c/364121/
Thanks,
Moshe Levi
8 years, 2 months
[libvirt] [PATCH v3 1/4] libxl: support serial list
by Bob Liu
Add support for multi serial devices, after this patch virsh can be used to
connect different serial devices of running domains. E.g.
vish # console <xxx> --devname serial<xxx>
Note:
This depends on a xen/libxl bug fix to have libxl_console_get_tty(...) correctly
returning the tty path (as opposed to always returning the first one).
[0] https://lists.xen.org/archives/html/xen-devel/2016-08/msg00438.html
Signed-off-by: Bob Liu <bob.liu(a)oracle.com>
---
v3: Comments from Jim.
v2: Add #ifdef LIBXL_HAVE_BUILDINFO_SERIAL_LIST.
---
src/libxl/libxl_conf.c | 23 ++++++++++++++++++++---
src/libxl/libxl_domain.c | 29 ++++++++++++++++++++++++++---
src/libxl/libxl_driver.c | 17 +++++++++--------
3 files changed, 55 insertions(+), 14 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 146e08a..32db975 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -431,14 +431,31 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
}
if (def->nserials) {
- if (def->nserials > 1) {
+ if (def->nserials == 1) {
+ if (libxlMakeChrdevStr(def->serials[0], &b_info->u.hvm.serial) <
+ 0)
+ return -1;
+ } else {
+#ifdef LIBXL_HAVE_BUILDINFO_SERIAL_LIST
+ if (VIR_ALLOC_N(b_info->u.hvm.serial_list, def->nserials + 1) <
+ 0)
+ return -1;
+ for (i = 0; i < def->nserials; i++) {
+ if (libxlMakeChrdevStr(def->serials[i],
+ &b_info->u.hvm.serial_list[i]) < 0)
+ {
+ libxl_string_list_dispose(&b_info->u.hvm.serial_list);
+ return -1;
+ }
+ }
+ b_info->u.hvm.serial_list[i] = NULL;
+#else
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
"%s",
_("Only one serial device is supported by libxl"));
return -1;
+#endif
}
- if (libxlMakeChrdevStr(def->serials[0], &b_info->u.hvm.serial) < 0)
- return -1;
}
if (def->nparallels) {
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 0e26b91..f529a2e 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -960,18 +960,20 @@ libxlConsoleCallback(libxl_ctx *ctx, libxl_event *ev, void *for_callback)
{
virDomainObjPtr vm = for_callback;
size_t i;
+ virDomainChrDefPtr chr;
+ char *console = NULL;
+ int ret;
virObjectLock(vm);
for (i = 0; i < vm->def->nconsoles; i++) {
- virDomainChrDefPtr chr = vm->def->consoles[i];
+ chr = vm->def->consoles[i];
+
if (i == 0 &&
chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL)
chr = vm->def->serials[0];
if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
libxl_console_type console_type;
- char *console = NULL;
- int ret;
console_type =
(chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL ?
@@ -989,6 +991,27 @@ libxlConsoleCallback(libxl_ctx *ctx, libxl_event *ev, void *for_callback)
VIR_FREE(console);
}
}
+ for (i = 0; i < vm->def->nserials; i++) {
+ chr = vm->def->serials[i];
+
+ ignore_value(virAsprintf(&chr->info.alias, "serial%zd", i));
+ if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
+ if (chr->source.data.file.path)
+ continue;
+ ret = libxl_console_get_tty(ctx, ev->domid,
+ chr->target.port,
+ LIBXL_CONSOLE_TYPE_SERIAL,
+ &console);
+ if (!ret) {
+ VIR_FREE(chr->source.data.file.path);
+ if (console && console[0] != '\0') {
+ ignore_value(VIR_STRDUP(chr->source.data.file.path,
+ console));
+ }
+ }
+ VIR_FREE(console);
+ }
+ }
virObjectUnlock(vm);
libxl_event_free(ctx, ev);
}
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index f153f69..a34eb02 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -4450,13 +4450,6 @@ libxlDomainOpenConsole(virDomainPtr dom,
virCheckFlags(VIR_DOMAIN_CONSOLE_FORCE, -1);
- if (dev_name) {
- /* XXX support device aliases in future */
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Named device aliases are not supported"));
- goto cleanup;
- }
-
if (!(vm = libxlDomObjFromDomain(dom)))
goto cleanup;
@@ -4472,8 +4465,16 @@ libxlDomainOpenConsole(virDomainPtr dom,
}
priv = vm->privateData;
+ if (dev_name) {
+ size_t i;
- if (vm->def->nconsoles) {
+ for (i = 0; !chr && i < vm->def->nserials; i++) {
+ if (STREQ(dev_name, vm->def->serials[i]->info.alias)) {
+ chr = vm->def->serials[i];
+ break;
+ }
+ }
+ } else if (vm->def->nconsoles) {
chr = vm->def->consoles[0];
if (chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL)
chr = vm->def->serials[0];
--
2.6.5
8 years, 2 months
[libvirt] [PATCH V2] virpci: support driver_override sysfs interface
by Jim Fehlig
libvirt uses the new_id PCI sysfs interface to bind a PCI stub driver
to a PCI device. The new_id interface is known to be buggy and racey,
hence a more deterministic interface was introduced in the 3.12 kernel:
driver_override. For more details see
https://www.redhat.com/archives/libvir-list/2016-June/msg02124.html
This patch adds support for the driver_override interface by
- adding new virPCIDevice{BindTo,UnbindFrom}StubWithOverride functions
that use the driver_override interface
- renames the existing virPCIDevice{BindTo,UnbindFrom}Stub functions
to virPCIDevice{BindTo,UnbindFrom}StubWithNewid to perserve existing
behavior on new_id interface
- changes virPCIDevice{BindTo,UnbindFrom}Stub function to call one of
the above depending on availability of driver_override
The patch includes a bit of duplicate code, but allows for easily
dropping the new_id code once support for older kernels is no
longer desired.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
V1:
https://www.redhat.com/archives/libvir-list/2016-July/msg00370.html
Changes since V1:
- drop patch1
- change patch2 to preserve the existing new_id code and add new
functions to implement the driver_override interface
src/util/virpci.c | 151 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 149 insertions(+), 2 deletions(-)
diff --git a/src/util/virpci.c b/src/util/virpci.c
index 132948d..6c8174a 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -1089,8 +1089,54 @@ virPCIDeviceUnbind(virPCIDevicePtr dev)
return ret;
}
+/*
+ * Bind a PCI device to a driver using driver_override sysfs interface.
+ * E.g.
+ *
+ * echo driver-name > /sys/bus/pci/devices/0000:03:00.0/driver_override
+ * echo 0000:03:00.0 > /sys/bus/pci/devices/0000:03:00.0/driver/unbind
+ * echo 0000:03:00.0 > /sys/bus/pci/drivers_probe
+ *
+ * An empty driverName will cause the device to be bound to its
+ * preferred driver.
+ */
static int
-virPCIDeviceUnbindFromStub(virPCIDevicePtr dev)
+virPCIDeviceBindWithDriverOverride(virPCIDevicePtr dev,
+ const char *driverName)
+{
+ int ret = -1;
+ char *path;
+
+ if (!(path = virPCIFile(dev->name, "driver_override")))
+ return -1;
+
+ if (virFileWriteStr(path, driverName, 0) < 0) {
+ virReportSystemError(errno,
+ _("Failed to add driver '%s' to driver_override "
+ " interface of PCI device '%s'"),
+ driverName, dev->name);
+ goto cleanup;
+ }
+
+ if (virPCIDeviceUnbind(dev) < 0)
+ goto cleanup;
+
+ if (virFileWriteStr(PCI_SYSFS "drivers_probe", dev->name, 0) < 0) {
+ virReportSystemError(errno,
+ _("Failed to trigger a probe for PCI device '%s'"),
+ dev->name);
+ goto cleanup;
+ }
+
+ ret = 0;
+
+ cleanup:
+ VIR_FREE(path);
+ return ret;
+}
+
+static int
+virPCIDeviceUnbindFromStubWithNewid(virPCIDevicePtr dev)
{
int result = -1;
char *drvdir = NULL;
@@ -1191,9 +1237,41 @@ virPCIDeviceUnbindFromStub(virPCIDevicePtr dev)
return result;
}
+static int
+virPCIDeviceUnbindFromStubWithOverride(virPCIDevicePtr dev)
+{
+ if (!dev->unbind_from_stub) {
+ VIR_DEBUG("Unbind from stub skipped for PCI device %s", dev->name);
+ return 0;
+ }
+
+ return virPCIDeviceBindWithDriverOverride(dev, "\n");
+}
+
+static int
+virPCIDeviceUnbindFromStub(virPCIDevicePtr dev)
+{
+ int ret;
+ char *path;
+
+ /*
+ * Prefer using the device's driver_override interface, falling back
+ * to the unpleasant new_id interface.
+ */
+ if (!(path = virPCIFile(dev->name, "driver_override")))
+ return -1;
+
+ if (virFileExists(path))
+ ret = virPCIDeviceUnbindFromStubWithOverride(dev);
+ else
+ ret = virPCIDeviceUnbindFromStubWithNewid(dev);
+
+ VIR_FREE(path);
+ return ret;
+}
static int
-virPCIDeviceBindToStub(virPCIDevicePtr dev)
+virPCIDeviceBindToStubWithNewid(virPCIDevicePtr dev)
{
int result = -1;
bool reprobe = false;
@@ -1345,6 +1423,75 @@ virPCIDeviceBindToStub(virPCIDevicePtr dev)
return result;
}
+static int
+virPCIDeviceBindToStubWithOverride(virPCIDevicePtr dev)
+{
+ int ret = -1;
+ const char *stubDriverName;
+ char *stubDriverPath = NULL;
+ char *driverLink = NULL;
+
+ /* Check the device is configured to use one of the known stub drivers */
+ if (dev->stubDriver == VIR_PCI_STUB_DRIVER_NONE) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("No stub driver configured for PCI device %s"),
+ dev->name);
+ return -1;
+ } else if (!(stubDriverName = virPCIStubDriverTypeToString(dev->stubDriver))) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown stub driver configured for PCI device %s"),
+ dev->name);
+ return -1;
+ }
+
+ if (!(stubDriverPath = virPCIDriverDir(stubDriverName)) ||
+ !(driverLink = virPCIFile(dev->name, "driver")))
+ goto cleanup;
+
+ if (virFileExists(driverLink)) {
+ if (virFileLinkPointsTo(driverLink, stubDriverPath)) {
+ /* The device is already bound to the correct driver */
+ VIR_DEBUG("Device %s is already bound to %s",
+ dev->name, stubDriverName);
+ ret = 0;
+ goto cleanup;
+ }
+ }
+
+ if (virPCIDeviceBindWithDriverOverride(dev, stubDriverName) < 0)
+ goto cleanup;
+
+ dev->unbind_from_stub = true;
+ ret = 0;
+
+ cleanup:
+ VIR_FREE(stubDriverPath);
+ VIR_FREE(driverLink);
+ return ret;
+}
+
+static int
+virPCIDeviceBindToStub(virPCIDevicePtr dev)
+{
+ int ret;
+ char *path;
+
+ /*
+ * Prefer using the device's driver_override interface, falling back
+ * to the unpleasant new_id interface.
+ */
+ if (!(path = virPCIFile(dev->name, "driver_override")))
+ return -1;
+
+ if (virFileExists(path))
+ ret = virPCIDeviceBindToStubWithOverride(dev);
+ else
+ ret = virPCIDeviceBindToStubWithNewid(dev);
+
+ VIR_FREE(path);
+ return ret;
+}
+
/* virPCIDeviceDetach:
*
* Detach this device from the host driver, attach it to the stub
--
2.1.4
8 years, 2 months
[libvirt] firewalld transaction model
by Thomas Woerner
Hello,
the transaction model that has been introduced with firewalld-0.4.2 makes it
possible to group rules together and to apply them at once and quick. For this
the restore commands of iptables, ip6tables and ebtables are used as long as
they are available.
At the moment the transaction model is only used inside of firewalld. It
applies all the generated and provided rules in a small amount of transactions.
This speeds up load and reload times of firewalld drastically.
There is no external interface to add transaction by services or applications
right now.
Because of this I'd like to get feedback from the D-Bus interface and command
line consumers: Is there interest in using transactions at all? What are the
needs and wishes?
With this information it should then be possible to get to a good and stable
interface. This will most likely an iterative process with some test and proof
of concept implementations.
Please provide information about your needs and wishes.
Regards,
Thomas
8 years, 2 months
[libvirt] wiki accounts for GSOC submissions
by Cole Robinson
Next week is the time for GSOC students to submit their Final Evaluations.
Work needs to be hosted/linked from a public URL. Cedric suggested using the
libvirt wiki for these pages, so something like:
http://wiki.libvirt.org/page/Google_Summer_of_Code_2016/My_Page_Title
And then we can link it from the top level Google_Summer_of_Code_2016 as well.
But this means GSOC students will need wiki accounts which needs admin
intervention.
GSOC students: if you don't already have libvirt wiki accounts, please respond
here with your desired username and email and one of the wiki admins will set
you up.
Thanks,
Cole
8 years, 2 months
[libvirt] Release of libvirt-2.2.0
by Daniel Veillard
Since the issue I had with rc2 was apparently just on my setup, I just pushed the release.
It is available as usual as signed tarball and rpms from :
ftp://libvirt.org/libvirt/
I also pushed 2.2.0 for the python bindings which you can find at:
ftp://libvirt.org/libvirt/python/
This is not a very big release, around 220 commits, august sounds like vacations, plus a number
of the developpers travelled to KVM forun so development took a bit of a hit. As a result we
have a release more inclined toward bug fixes though there is some features and notable improvements:
Features:
- Sparse vCPU topologies support and assorted vCPU improvements (Peter Krempa)
- Various improvements and fixes for vz driver (Olga Krishtal, Nikolay Shirokovskiy, Maxim Nestratov, Pavel Glushchak, Mikhail Feoktistov)
- Various improvements and fixes for libxl driver (Cédric Bosdonnat, Jim Fehlig, Chunyan Liu, Roman Bogorodskiy)
Documentation:
- docs: Add missing / to closing tag (Christophe Fergeau)
- doc: clarify documentation for vcpu order (Peter Krempa)
- storage_backend_rbd: fix typos (Chen Hanxiao)
- qemu_driver: update comments for qemuDomainSaveInternal (Chen Hanxiao)
- virsh: clarify snapshot --live (Chen Hanxiao)
Portability:
- conf: Fix build with picky GCC (Peter Krempa)
- tests: fix domaincapstest linking for libxl (Roman Bogorodskiy)
- libxl: fix unused functions (Roman Bogorodskiy)
- docs: Distribute subsite.xsl (Michal Privoznik)
- nsslinktest: also build virAtomic.h (Kai Kang)
- build: centralize use of extra Cygwin LDFLAGS (Eric Blake)
- build: use XDR_CFLAGS for Cygwin build (Eric Blake)
Bug Fixes:
- tests: fix segfault in objecteventtest (Roman Bogorodskiy)
- bhyve: fix disks address allocation (Roman Bogorodskiy)
- Check for --live flag for postcopy-after-precopy migration (Kothapally Madhu Pavan)
- qemu: driver: Validate configuration when setting maximum vcpu count (Peter Krempa)
- conf: Don't validate vcpu count in XML parser (Peter Krempa)
- qemu: driver: Fix qemuDomainHelperGetVcpus for sparse vcpu topologies (Peter Krempa)
- vz: fixed race in vzDomainAttach/DettachDevice (Olga Krishtal)
- qemu: fix ethernet network type ip/route assign (Vasiliy Tolstov)
- Fix remote_protocol-structs after recent commit (Peter Krempa)
- network: Need to free formatted addr in networkDnsmasqConfContents (John Ferlan)
- remove the dead code this patch is to remove the dead code Signed-off-by: JieWang <wangjie88(a)huawei.com> (JieWang)
- qemu: Fix crash hot plugging luks volume (John Ferlan)
- networkxml2conftest: Don't leak dnsmasq capabilities (Michal Privoznik)
- vz: fixed race in vzDomainAttach/DettachDevice (Olga Krishtal)
- qemu: Fix the command line generation for rbd auth using aes secrets (John Ferlan)
- qemu_process: graphics: setup listen types before ports are reserved/allocated (Pavel Hrdina)
- conf: Provide error on undefined iothreadsched entry (John Ferlan)
- utils: storage: Fix JSON field name for uri based storage (Peter Krempa)
- conf: free the ports array of a USB hub (Ján Tomko)
- lxc: don't try to reference NULL when mounting filesystems (Daniel P. Berrange)
- lxc: don't try to resolve a NULL path for filesystems (Daniel P. Berrange)
- virsh: Fix core for cmdSecretGetValue (John Ferlan)
- virschematest: Make sure that validator is initialized (Michal Privoznik)
- cpu_x86: fix libvirtd crash when host cpu vendor is not available (Jim Fehlig)
- virschematest: Initialize @data (Michal Privoznik)
- schema: Don't validate paths (Michal Privoznik)
- virNetDevMacVLanCreateWithVPortProfile: Don't mask virNetDevMacVLanTapOpen error (Michal Privoznik)
- qemu: fix qemu.conf security_driver (Cole Robinson)
- conf: restrict expander buses to connect only to a root bus (Laine Stump)
- conf: restrict where dmi-to-pci-bridge can be connected (Laine Stump)
- conf: don't allow connecting upstream-port directly to pce-expander-bus (Laine Stump)
- conf: improve error log when PCI devices don't match requested controller (Laine Stump)
- virt-admin: Fix the error when an invalid URI has been provided (Erik Skultety)
- cpu_x86: Fix host-model CPUs on hosts with CMT (Jiri Denemark)
- virt-admin: Properly fix the default session daemon URI to admin server (Erik Skultety)
- admin: Fix the default uri for session daemon to libvirtd:///session (Erik Skultety)
- virsystemd: Fix error check (Marc Hartmayer)
- lxcDomainCreateXMLWithFiles: Avoid crash (Michal Privoznik)
- storage: Don't remove the pool for buildPool failure in storagePoolCreate (John Ferlan)
- storage: Fix a NULL ptr dereference in virStorageBackendCreateQemuImg (Erik Skultety)
- tests: Fix broken build (John Ferlan)
- qemu: fix capability counting (Boris Fiuczynski)
- virObjectEventNew: Use virObjectUnref() to free virObjectEvent (Michal Privoznik)
- virshConnect: Don't leak polkit agent (Michal Privoznik)
- conf: events: Fix coverity warning (Cole Robinson)
- Don't error when attaching security label of model "none" (Daniel P. Berrange)
- qemu: only report errno in trace message on failure (Daniel P. Berrange)
- qemu: Set fake reboot flag to false when mode=agent (Nikolay Shirokovskiy)
- libxl: Fix broken build attach/detach controller device (John Ferlan)
- libxl: Fix broken build from libxlDomainCleanup (John Ferlan)
- admin: rpc: virnetserver: Fix updating of the client limits (Erik Skultety)
- libxl: fix segfault in libxlReconnectDomain (Cédric Bosdonnat)
- qemu: Fix domain state after reset (Martin Kletzander)
- virsh: Report error when explicit connection fails (Martin Kletzander)
- qemu: Fix support for startupPolicy with volume/pool disks (Martin Kletzander)
Improvements:
- tools: Don't list virsh-* under EXTRA_DIST (Michal Privoznik)
- libxl: advertise support for migration V3 (Jim Fehlig)
- virsh: vcpuinfo: Report vcpu number from the structure rather than it's position (Peter Krempa)
- vz: getting bus type for containers (Mikhail Feoktistov)
- vz: update domain cache after device updates (Nikolay Shirokovskiy)
- vz: added VIR_MIGRATE_PARAM_BANDWIDTH param handling (Pavel Glushchak)
- vz: implicitly support additional migration flags (Pavel Glushchak)
- qemu: set tap device online for type='ethernet' (Laine Stump)
- qemu: remove unnecessary setting of tap device online state (Laine Stump)
- qemu: hotplug: Add support for VCPU unplug (Peter Krempa)
- qemu: hotplug: Allow marking unplugged devices by alias (Peter Krempa)
- qemu: Use modern vcpu hotplug approach if possible (Peter Krempa)
- qemu: command: Add support for sparse vcpu topologies (Peter Krempa)
- qemu: process: Copy final vcpu order information into the vcpu definition (Peter Krempa)
- qemu: command: Add helper to convert vcpu definition to JSON props (Peter Krempa)
- qemu: migration: Prepare for non-contiguous vcpu configurations (Peter Krempa)
- conf: Add XML for individual vCPU hotplug (Peter Krempa)
- util: Extract and rename qemuDomainDelCgroupForThread to virCgroupDelThread (Peter Krempa)
- qemu: domain: Prepare for VCPUs vanishing while libvirt is not running (Peter Krempa)
- qemu: domain: Extract cpu-hotplug related data (Peter Krempa)
- tests: cpu-hotplug: Add data for ppc64 without threads enabled (Peter Krempa)
- tests: cpu-hotplug: Add data for ppc64 out-of-order hotplug (Peter Krempa)
- tests: cpu-hotplug: Add data for ppc64 platform including hotplug (Peter Krempa)
- tests: cpu-hotplug: Add data for x86 hotplug with 11+ vcpus (Peter Krempa)
- tests: Add test infrastructure for qemuMonitorGetCPUInfo (Peter Krempa)
- qemu: monitor: Add algorithm for combining query-(hotpluggable-)-cpus data (Peter Krempa)
- qemu: monitor: Add support for calling query-hotpluggable-cpus (Peter Krempa)
- qemu: monitor: Extract QOM path from query-cpus reply (Peter Krempa)
- qemu: capabilities: Extract availability of new cpu hotplug for machine types (Peter Krempa)
- qemu: Forbid config when topology based cpu count doesn't match the config (Peter Krempa)
- qemu: Add capability for query-hotpluggable-cpus command (Peter Krempa)
- qemu: monitor: Return struct from qemuMonitor(Text|Json)QueryCPUs (Peter Krempa)
- qemu: monitor: Return structures from qemuMonitorGetCPUInfo (Peter Krempa)
- virsh: use vshError consistently after virBufferError checks (Pino Toscano)
- virsh: avoid i18n puzzle (Pino Toscano)
- virsh: respect -q/--quiet more (Pino Toscano)
- vz: add ACL checks to API calls (Nikolay Shirokovskiy)
- remote: rename protocol names for close callbacks (Nikolay Shirokovskiy)
- vz: prepare migration for ACL checks (Nikolay Shirokovskiy)
- vz: expand setting memory API calls (Nikolay Shirokovskiy)
- vz: add missing flagged versions of API functions (Nikolay Shirokovskiy)
- vz: factor out converting block stats to params (Nikolay Shirokovskiy)
- vz: factor out block stats impl (Nikolay Shirokovskiy)
- vz: implement plain create API thru createFlags instead of visa versa (Nikolay Shirokovskiy)
- vz: expand start/stop/... APIs for ACL checks (Nikolay Shirokovskiy)
- network: allow limiting a <forwarder> element to certain domains (Laine Stump)
- network: allow disabling dnsmasq's DNS server (Laine Stump)
- network: new network forward mode 'open' (Laine Stump)
- vz: add validation callbacks (Mikhail Feoktistov)
- vz: specify VIR_DOMAIN_NET_TYPE_NETWORK for routed networks (Maxim Nestratov)
- vz: reset errors after ignoring return values (Maxim Nestratov)
- vz: don't fail query domain info in case we don't have valid stats handle (Maxim Nestratov)
- vz: get additional error information from job correctly (Maxim Nestratov)
- cfg.mk: join not_streq and not_strneq tests (Ján Tomko)
- cfg.mk: drop redundant sc_prohibit_gethostby (Ján Tomko)
- cfg.mk: use subst instead of tr (Ján Tomko)
- tests: fix the return value of test-wrap-argv (Ján Tomko)
- maint: update to latest gnulib (Ján Tomko)
- Introduce QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY (Ján Tomko)
- conf: Provide error on undefined vcpusched entry (John Ferlan)
- qemu_process: graphics: reserve port only if listen type is address or network (Pavel Hrdina)
- qemu_process: graphics: extract for loop out of qemuProcessGraphicsReservePorts (Pavel Hrdina)
- qemu_process: graphics: extract port allocation into function (Pavel Hrdina)
- qemu_process: graphics: ref driver config only in function where it is used (Pavel Hrdina)
- util: Make virStringArrayHasString() const-correct (Andrea Bolognani)
- qemu: driver: Split out regular vcpu hotplug code into a function (Peter Krempa)
- qemu: driver: Extract setting of live vcpu count (Peter Krempa)
- qemu: setvcpus: Extract setting of maximum vcpu count (Peter Krempa)
- conf: report an error message for non-existing USB hubs (Ján Tomko)
- qemu: setcpus: Report better errors (Peter Krempa)
- libxl_driver: Indent LIBXL_VBD_SECTOR_SIZE macro correctly (Michal Privoznik)
- Introduce node device update event as top level event (Jovanka Gulicoska)
- qemu_command: don't modify heads for graphics device (Pavel Hrdina)
- qemu: command: Simplify USB controller model selection (Andrea Bolognani)
- qemu: domain: Drop piix3-ohci controller for migration (Andrea Bolognani)
- qemu: domain: Reflect USB controller model in guest XML (Andrea Bolognani)
- virNetDevMacVLanCreateWithVPortProfile: Drop @ret (Michal Privoznik)
- virNetDevMacVLanCreateWithVPortProfile: Drop @rc (Michal Privoznik)
- tests: Add a test for host-model CPU with CMT feature (Jiri Denemark)
- cpu_x86: Properly drop non-migratable features (Jiri Denemark)
- cpu_x86: Introduce x86FeatureIsMigratable (Jiri Denemark)
- virsh: Introduce nodedev-event command (Jovanka Gulicoska)
- vz: add vzDomainGetJobStats (Nikolay Shirokovskiy)
- vz: add getting job info for migration (Nikolay Shirokovskiy)
- Fix indentation (Ján Tomko)
- qemu: Add tests for virQEMUCapsNewCopy (Jiri Denemark)
- qemu: Copy missing QEMU caps elements (Jiri Denemark)
- qemu: Copy QEMU caps elements in order of definition (Jiri Denemark)
- tests: qemucapabilities: Add data for qemu 2.7.0 (Peter Krempa)
- internal: Introduce macro for stealing pointers (Peter Krempa)
- qemu: Advertise OVMF_CODE.secboot.fd (Michal Privoznik)
- qemu: Enable secure boot (Michal Privoznik)
- Introduce @secure attribute to os loader element (Michal Privoznik)
- Introduce SMM feature (Michal Privoznik)
- qemuBuildMachineCommandLine: Follow our pattern (Michal Privoznik)
- rpm: set TLS priority to @LIBVIRT,SYSTEM on Fedora >= 25 (Daniel P. Berrange)
- tests: qemuxml2xml: Add some USB test cases (Andrea Bolognani)
- tests: qemuxml2xml: Use DO_TEST() for most tests (Andrea Bolognani)
- tests: qemuxml2xml: Pass capabilities to DO_TEST() (Andrea Bolognani)
- tests: qemuxml2xml: Use WHEN_BOTH for most tests (Andrea Bolognani)
- tests: qemuxml2xml: Clean up disk-mirror (Andrea Bolognani)
- tests: qemuxml2argv: Fix usb-too-long-port-path-invalid (Andrea Bolognani)
- tests: qemuxml2argv: Remove useless GIC flags (Andrea Bolognani)
- libxlDoMigrateReceive: Drop useless check for !vm (Michal Privoznik)
- securityselinuxlabeltest: Prefer virGetLastErrorMessage() over virGetLastError (Michal Privoznik)
- virqemu: Reflect return type of virJSONValueArraySize() (Michal Privoznik)
- qemu: domain: Simplify return values of qemuDomainRefreshVcpuInfo (Peter Krempa)
- qemu: domain: Improve vCPU data checking in qemuDomainRefreshVcpu (Peter Krempa)
- qemu: monitor: Rename qemuMonitor(JSON|Text)GetCPUInfo (Peter Krempa)
- qemu: domain: Rename qemuDomainDetectVcpuPids to qemuDomainRefreshVcpuInfo (Peter Krempa)
- qemu: Improve error message in virDomainGetVcpus (Peter Krempa)
- qemu: monitor: Add do-while block to QEMU_CHECK_MONITOR_FULL (Peter Krempa)
- qemu: monitor: Add monitor API for device_add supporting JSON objects (Peter Krempa)
- libxl: allow libxl to calculate shadow mem requirements (Jim Fehlig)
- qemu: Add support to get/set IOThread period and quota cgroup values (John Ferlan)
- conf: Add IOThread quota and period scheduler/cputune defs (John Ferlan)
- virsh: qemu-monitor-command: Don't print extra newline with --pretty (Peter Krempa)
- tests: Make schema test fail on XML schema errors (Peter Krempa)
- remote: Fix indentation of the remote protocol structs check file (Peter Krempa)
- qemu: Use the hostdev alias in qemuDomainAttachHostSCSIDevice error path (John Ferlan)
- qemu: Use qemuAliasFromHostdev (John Ferlan)
- qemu: Introduce qemuAliasFromHostdev (John Ferlan)
- qemu: Add attempt to call qemuMonitorDriveDel for AttachSCSI failure path (John Ferlan)
- qemu: Add attempt to call qemuMonitorDriveDel for USB failure path (John Ferlan)
- qemu: Make QEMU_DRIVE_HOST_PREFIX more private (John Ferlan)
- qemu: Use qemuAliasFromDisk to generate drive alias (John Ferlan)
- qemu: Use qemuAliasFromDisk instead of qemuDeviceDriveHostAlias (John Ferlan)
- qemu: Use qemuAliasFromDisk to generate drive alias (John Ferlan)
- qemu: Remove generation of drive alias from qcow passphrase backends (John Ferlan)
- qemu: Reorder qemuDomainAttachUSBMassStorageDevice failure path (John Ferlan)
- event-test: support node device lifecycle event APIs (Jovanka Gulicoska)
- node_device: Implement event queue in udev (Jovanka Gulicoska)
- node_device: implement node device lifecycle event APIs (Jovanka Gulicoska)
- remote: implement node device lifecycle event APIs (Jovanka Gulicoska)
- test: implement node device lifecycle event APIs (Jovanka Gulicoska)
- conf: add node_device_event handling (Jovanka Gulicoska)
- Introduce node device lifecycle event APIs (Jovanka Gulicoska)
- qemu: Set fake reboot flag only in acpi mode for shutdown (Nikolay Shirokovskiy)
- rpc: virnetserver: Remove dead code checking the client limits (Erik Skultety)
- rpc: virnetserver: Add code to CheckLimits to handle suspending of services (Erik Skultety)
- rpc: virnetserver: Move virNetServerCheckLimits which is static up in the file (Erik Skultety)
- rpc: virnetserver: Rename ClientSetProcessingControls to ClientSetLimits (Erik Skultety)
- libxl: add hooks support (Cédric Bosdonnat)
- libxl: add a flag to mark guests as tainted by a hook (Cédric Bosdonnat)
- qemuDomainDeviceDefPostParse: add USB controller model check (Chunyan Liu)
- xenconfig: add conversion of usb controller config to and from xml (Chunyan Liu)
- libxl: check available controller and port when hotplugging USB device (Chunyan Liu)
- libxl: support usb controller hotplug (Chunyan Liu)
- libxl: support USB controllers in creation time (Chunyan Liu)
- extend usb controller model to support xen pvusb (Chunyan Liu)
- virsh: qemu-monitor-command: Simplify control flow (Peter Krempa)
- virsh: qemu-monitor-command: Use macro for exclusive options (Peter Krempa)
- qemu: cap: Refactor access to array in virQEMUCapsProbeQMPMachineTypes (Peter Krempa)
- qemu: caps: Sanitize storage of machine type related data (Peter Krempa)
- qemu: capabilities: Drop unused function virQEMUCapsGetMachineTypes (Peter Krempa)
- storage: Clean up volume wiping (Martin Kletzander)
- storage: Use path instead of volume as an argument (Martin Kletzander)
- storage: Move functions around (Martin Kletzander)
- qemu: Remove unnecessary label and its only reference (Martin Kletzander)
- qemu: Make qemuDomainCheckDiskStartupPolicy self-contained (Martin Kletzander)
- Post-release version bump to 2.2.0 (Michal Privoznik)
- Fix unbalanced quotation marks (Yuri Chornoivan)
thanks everybody who helped putting this release out, be it with ideas, code, reviews,
bug reports, localization, docs, etc...
Enjoy !
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, 2 months
[libvirt] [PATCH] libxl: add memory attach support
by Bob Liu
Support for VIR_DOMAIN_DEVICE_MEMORY on domainAttachDeviceFlags API in libxl
driver, using libxl_set_memory_target in xen libxl.
With "virsh attach-device" command we can then hotplug memory to a domain:
<memory model='dimm'>
<target>
<size unit='MiB'>128</size>
<node>0</node>
</target>
</memory>
$ virsh attach-device domain_name this.xml --live
Signed-off-by: Bob Liu <bob.liu(a)oracle.com>
---
src/libxl/libxl_domain.c | 1 +
src/libxl/libxl_driver.c | 29 +++++++++++++++++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index f529a2e..3924ba0 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -414,6 +414,7 @@ virDomainDefParserConfig libxlDomainDefParserConfig = {
.macPrefix = { 0x00, 0x16, 0x3e },
.devicesPostParseCallback = libxlDomainDeviceDefPostParse,
.domainPostParseCallback = libxlDomainDefPostParse,
+ .features = VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG
};
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index a34eb02..541ea3b 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3085,6 +3085,30 @@ libxlDomainAttachHostUSBDevice(libxlDriverPrivatePtr driver,
#endif
static int
+libxlDomainAttachMemory(libxlDriverPrivatePtr driver,
+ virDomainObjPtr vm,
+ virDomainMemoryDefPtr mem)
+{
+ int res = 0;
+ libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
+
+ if (mem->targetNode != 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("unsupport non-zero target node for memory device"));
+ return -1;
+ }
+
+ res = libxl_set_memory_target(cfg->ctx, vm->def->id, mem->size, 1, 1);
+ if (res < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to attach %lluKB memory for domain %d"),
+ mem->size, vm->def->id);
+ return -1;
+ }
+ return 0;
+}
+
+static int
libxlDomainAttachHostDevice(libxlDriverPrivatePtr driver,
virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev)
@@ -3284,6 +3308,11 @@ libxlDomainAttachDeviceLive(libxlDriverPrivatePtr driver,
dev->data.hostdev = NULL;
break;
+ case VIR_DOMAIN_DEVICE_MEMORY:
+ ret = libxlDomainAttachMemory(driver, vm, dev->data.memory);
+ dev->data.memory = NULL;
+ break;
+
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("device type '%s' cannot be attached"),
--
2.6.5
8 years, 2 months
[libvirt] Querying block device job status and semantics of virDomainBlockJobInfo()
by Kashyap Chamarthy
In OpenStack Nova, we're trying to analyze a potential race
condition[0]. The operation flow is something like: perform a live
shallow blockRebase(), check for progress with blockJobInfo(), followed
by a blockJobAbort() (QMP 'block-job-cancel') to get a live
point-in-time snapshot, then convert the resulting shallow copy with a
backing file into a flattenned image with (`qemu-img convert`), and Nova
uploads that into the image repository (Glance). Nova uses some
wrappers around the above APIs, and calls them this way, in its
_live_snapshot() method[1]:
[...]
dev.rebase(disk_delta, copy=True, reuse_ext=True, shallow=True)
while dev.wait_for_job():
time.sleep(0.5)
dev.abort_job()
[...]
Looking at a failed blockRebase() operation from libvirt debug log, the
root cause turns out to be libvirt issuing QMP command
'block-job-cancel' (blockJobAbort()) when the block device job status
is "ready": false, which results in a corrupted destination file. (In
a successful case, QMP command 'block-job-cancel' should be issued when
the job status is: "ready": true).
My libvirtd log analysis in the Nova bug is here[2] from a failed case,
which has QMP traffic back-n-forth.
- - -
So, I'm trying to understand how libvirt reports the "cur" and "end"
values. I've read the virDomainBlockJobInfo() struct, it wasn't crystal
clear. It states:
/*
* The following fields provide an indication of block job progress. @cur
* indicates the current position and will be between 0 and @end. @end is
* the final cursor position for this operation and represents completion.
* To approximate progress, divide @cur by @end.
*/
Now, if a job hasn't started, what would libvirt report? Talking to
Michal Privoznik on IRC:
[mprivozn]
I wonder if libvirt should report something else than start=0 end=0
in order to tell the caller that job hasn't been started yet. I
suspect that libvirt does not report correctly whether job has
started already, which in turns forces Nova to use some workarounds.
[kashyap]
So, if the job hasn't started yet, what should libvirt report?
[mprivozn]
That's the question. We can't change the [virDomainBlockJobInfo]
struct (otherwise we won't be ABI compatible), so we can't really
add a bolean there 'bool job_started'.
Or we can introduce new "job type" which wouldn't really be a job
type, but we will fill status.job with it to say explicitly job
hasn't started yet
So, any other thoughts here, on how to proceed here?
- - -
I realize that a copy job has two phases, as clearly stated in the API
documenation of virDomainBlockRebase()[3]:
"[...] The job transitions to the second phase when the job info
states cur == end, and remains alive to mirror all further changes to
both source and destination. The user must call
virDomainBlockJobAbort() to end the mirroring while choosing whether
to revert to source or pivot to the destination. [...]"
[0] https://bugs.launchpad.net/nova/+bug/1530275
[1] https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py...
[2] https://bugs.launchpad.net/nova/+bug/1530275/comments/16 --
Live snapshot is corrupted (possibly race condition?)
[3] https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockRebase
--
/kashyap
8 years, 2 months
[libvirt] [PATCH] Make --postcopy flag mandatory with --postcopy-after-precopy
by Kothapally Madhu Pavan
--postcopy-after-precopy is just an aditional flag for
postcopy migration.
Signed-off-by: Kothapally Madhu Pavan <kmp(a)linux.vnet.ibm.com>
---
tools/virsh-domain.c | 6 +++---
tools/virsh.pod | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index c9ad0d7..a614512 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -10318,10 +10318,10 @@ cmdMigrate(vshControl *ctl, const vshCmd *cmd)
}
if (vshCommandOptBool(cmd, "postcopy-after-precopy")) {
- if (!live_flag) {
+ if (!vshCommandOptBool(cmd, "postcopy")) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
- _("post-copy migration is not supported with "
- "non-live or paused migration"));
+ _("--postcopy-after-precopy can only be used with "
+ "--postcopy"));
goto cleanup;
}
iterEvent = virConnectDomainEventRegisterAny(
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 1e36ee1..3670ace 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1617,8 +1617,8 @@ migration. I<--postcopy> enables post-copy logic in migration, but does not
actually start post-copy, i.e., migration is started in pre-copy mode.
Once migration is running, the user may switch to post-copy using the
B<migrate-postcopy> command sent from another virsh instance or use
-I<--postcopy-after-precopy> to let libvirt automatically switch to
-post-copy after the first pass of pre-copy is finished.
+I<--postcopy-after-precopy> along with I<--postcopy> to let libvirt automatically
+switch to post-copy after the first pass of pre-copy is finished.
I<--auto-converge> forces convergence during live migration. The initial
guest CPU throttling rate can be set with I<auto-converge-initial>. If the
8 years, 2 months