[libvirt] [PATCH v2] virNetDevIPCheckIPv6ForwardingCallback fixes
by Cédric Bosdonnat
Add check for more than one RTA_OIF, even though this is rather
unlikely.
Get rid of the buggy switch / break as this code won't need to
handle more attributes.
Use VIR_WARNINGS_NO_CAST_ALIGN to fix impossible to fix
util/virnetdevip.c:560:17: error: cast increases required alignment of target type [-Werror=cast-align]
---
Diff to v1:
* Add error message
* Use VIR_WARNINGS_NO_CAST_ALIGN
src/util/virnetdevip.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c
index c9ac6baf7..726fa6c3e 100644
--- a/src/util/virnetdevip.c
+++ b/src/util/virnetdevip.c
@@ -556,15 +556,24 @@ virNetDevIPCheckIPv6ForwardingCallback(const struct nlmsghdr *resp,
if (resp->nlmsg_type != RTM_NEWROUTE)
return ret;
- /* Extract a few attributes */
+ /* Extract a device ID attribute */
+ VIR_WARNINGS_NO_CAST_ALIGN
for (rta = RTM_RTA(rtmsg); RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) {
- switch (rta->rta_type) {
- case RTA_OIF:
+ VIR_WARNINGS_RESET
+ if (rta->rta_type == RTA_OIF) {
oif = *(int *)RTA_DATA(rta);
+ /* Should never happen: netlink message would be broken */
+ if (ifname) {
+ char *ifname2 = virNetDevGetName(oif);
+ VIR_WARN("Single route has unexpected 2nd interface "
+ "- '%s' and '%s'", ifname, ifname2);
+ VIR_FREE(ifname2);
+ break;
+ }
+
if (!(ifname = virNetDevGetName(oif)))
goto error;
- break;
}
}
--
2.12.0
7 years, 8 months
[libvirt] [PATCH] qemu: Add device id for mediated devices on qemu command line
by Erik Skultety
Like all devices, add the 'id' option for mdevs as well. Patch also
adjusts the test accordingly.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1438431
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
src/qemu/qemu_command.c | 3 ++-
tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 5cf383aaea..445c696d6e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5231,7 +5231,8 @@ qemuBuildHostdevMediatedDevStr(const virDomainDef *def,
char *ret = NULL;
virBufferAddLit(&buf, "vfio-pci");
- virBufferAsprintf(&buf, ",sysfsdev=%s",
+ virBufferAsprintf(&buf, ",id=%s,sysfsdev=%s",
+ dev->info->alias,
virMediatedDeviceGetSysfsPath(mdevsrc->uuidstr));
if (qemuBuildDeviceAddressStr(&buf, def, dev->info, qemuCaps) < 0)
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args
index fdefeb6104..76e77707bf 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args
@@ -20,6 +20,6 @@ QEMU_AUDIO_DRV=none \
-usb \
-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--device vfio-pci,\
+-device vfio-pci,id=hostdev0,\
sysfsdev=/sys/bus/mdev/devices/53764d0e-85a0-42b4-af5c-2046b460b1dc,bus=pci.0,\
addr=0x3
--
2.12.2
7 years, 8 months
[libvirt] [PATCH 0/5] Split out network object into its own module
by John Ferlan
Reached the last of the code from my RFC for making a common pool
object - networkobj... For reference see patch 3 of:
http://www.redhat.com/archives/libvir-list/2017-February/msg00519.html
This series works through the network conf adjustments. This pile is
fairly straightforward, like other series we split out anything referencing
virNetworkPoolObj and go from there. There was one small detour to avoid
a potentially conflict in names.
John Ferlan (5):
conf: Introduce virnetworkobj
conf: Adjust coding style for network conf sources
conf: Alter coding style of network conf function prototypes
conf: Rename virNetworkObjAssignDef to virNetworkObjUpdateAssignDef
conf: Use consistent function name prefixes for virnetworkobj
po/POTFILES.in | 1 +
src/Makefile.am | 3 +-
src/conf/network_conf.c | 1387 ++--------------------------------
src/conf/network_conf.h | 204 ++---
src/conf/virnetworkobj.c | 1371 +++++++++++++++++++++++++++++++++
src/conf/virnetworkobj.h | 185 +++++
src/libvirt_private.syms | 57 +-
src/network/bridge_driver.c | 62 +-
src/network/bridge_driver.h | 2 +-
src/network/bridge_driver_platform.h | 2 +-
src/test/test_driver.c | 16 +-
11 files changed, 1762 insertions(+), 1528 deletions(-)
create mode 100644 src/conf/virnetworkobj.c
create mode 100644 src/conf/virnetworkobj.h
--
2.9.3
7 years, 8 months
[libvirt] [libvirt-perl][PATCH 0/3] Reflect upstream changes
by Michal Privoznik
Couple of new APIs and constants were added to libvirt.
Reflect them in the perl bindings.
Michal Privoznik (3):
Add block threshold event
Add virDomainSetBlockThreshold API
Add VIR_MIGRATE_TLS constant
Changes | 3 +++
Virt.xs | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++
lib/Sys/Virt/Domain.pm | 22 ++++++++++++++++++
t/030-api-coverage.t | 1 +
4 files changed, 87 insertions(+)
--
2.10.2
7 years, 8 months
[libvirt] [PATCH] storage: Fix capacity value for LUKS encrypted volumes
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1371892
The 'capacity' value (e.g. guest logical size) for a LUKS volume is
smaller than the 'physical' value of the file in the file system, so
we need to account for that.
When peeking at the encryption information about the volume add a fetch
of the payload_offset which is described as the offset to the start of
the volume data (in 512 byte sectors) in QEMU's QCryptoBlockLUKSHeader.
Then adjust the ->capacity appropriately when we determine that the
volume target encryption has a payload_offset value.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/storage/storage_util.c | 3 +++
src/util/virstorageencryption.h | 1 +
src/util/virstoragefile.c | 39 +++++++++++++++++++++++++++++++++++++++
3 files changed, 43 insertions(+)
diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 38d373e..213f173 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -3436,6 +3436,9 @@ storageBackendProbeTarget(virStorageSourcePtr target,
target->capacity = meta->capacity;
if (encryption && meta->encryption) {
+ if (meta->encryption->payload_offset != -1)
+ target->capacity -= meta->encryption->payload_offset * 512;
+
*encryption = meta->encryption;
meta->encryption = NULL;
diff --git a/src/util/virstorageencryption.h b/src/util/virstorageencryption.h
index fa439fb..42f990c 100644
--- a/src/util/virstorageencryption.h
+++ b/src/util/virstorageencryption.h
@@ -70,6 +70,7 @@ typedef struct _virStorageEncryption virStorageEncryption;
typedef virStorageEncryption *virStorageEncryptionPtr;
struct _virStorageEncryption {
int format; /* virStorageEncryptionFormatType */
+ int payload_offset;
size_t nsecrets;
virStorageEncryptionSecretPtr *secrets;
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index c9420fd..7b30143 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -133,6 +133,8 @@ struct FileEncryptionInfo {
int modeOffset; /* Byte offset of the format native encryption mode */
char modeValue; /* Value expected at offset */
+
+ int payloadOffset; /* start offset of the volume data (in 512 byte sectors) */
};
/* Either 'magic' or 'extension' *must* be provided */
@@ -212,9 +214,18 @@ qedGetBackingStore(char **, int *, const char *, size_t);
#define LUKS_HDR_MAGIC_LEN 6
#define LUKS_HDR_VERSION_LEN 2
+#define LUKS_HDR_CIPHER_NAME_LEN 32
+#define LUKS_HDR_CIPHER_MODE_LEN 32
+#define LUKS_HDR_HASH_SPEC_LEN 32
+#define LUKS_HDR_PAYLOAD_LEN 4
/* Format described by qemu commit id '3e308f20e' */
#define LUKS_HDR_VERSION_OFFSET LUKS_HDR_MAGIC_LEN
+#define LUKS_HDR_PAYLOAD_OFFSET (LUKS_HDR_MAGIC_LEN+\
+ LUKS_HDR_VERSION_LEN+\
+ LUKS_HDR_CIPHER_NAME_LEN+\
+ LUKS_HDR_CIPHER_MODE_LEN+\
+ LUKS_HDR_HASH_SPEC_LEN)
static struct FileEncryptionInfo const luksEncryptionInfo[] = {
{
@@ -231,6 +242,8 @@ static struct FileEncryptionInfo const luksEncryptionInfo[] = {
.modeOffset = -1,
.modeValue = -1,
+
+ .payloadOffset = LUKS_HDR_PAYLOAD_OFFSET,
},
{ 0 }
};
@@ -249,6 +262,8 @@ static struct FileEncryptionInfo const qcow1EncryptionInfo[] = {
.modeOffset = QCOW1_HDR_CRYPT,
.modeValue = 1,
+
+ .payloadOffset = -1,
},
{ 0 }
};
@@ -267,6 +282,8 @@ static struct FileEncryptionInfo const qcow2EncryptionInfo[] = {
.modeOffset = QCOW2_HDR_CRYPT,
.modeValue = 1,
+
+ .payloadOffset = -1,
},
{ 0 }
};
@@ -921,6 +938,23 @@ virStorageFileHasEncryptionFormat(const struct FileEncryptionInfo *info,
}
+static int
+virStorageFileGetEncryptionPayloadOffset(const struct FileEncryptionInfo *info,
+ char *buf)
+{
+ int payload_offset = -1;
+
+ if (info->payloadOffset != -1) {
+ if (info->endian == LV_LITTLE_ENDIAN)
+ payload_offset = virReadBufInt32LE(buf + info->payloadOffset);
+ else
+ payload_offset = virReadBufInt32BE(buf + info->payloadOffset);
+ }
+
+ return payload_offset;
+}
+
+
/* Given a header in BUF with length LEN, as parsed from the storage file
* assuming it has the given FORMAT, populate information into META
* with information about the file and its backing store. Return format
@@ -967,6 +1001,8 @@ virStorageFileGetMetadataInternal(virStorageSourcePtr meta,
goto cleanup;
}
}
+ meta->encryption->payload_offset =
+ virStorageFileGetEncryptionPayloadOffset(&fileTypeInfo[meta->format].cryptInfo[i], buf);
}
}
}
@@ -3372,6 +3408,9 @@ virStorageSourceUpdateCapacity(virStorageSourcePtr src,
else
goto cleanup;
+ if (src->encryption && src->encryption->payload_offset != -1)
+ src->capacity -= src->encryption->payload_offset * 512;
+
ret = 0;
cleanup:
--
2.9.3
7 years, 8 months
[libvirt] [PATCH V3] util: Add more virsysfs functions for handling resctrl sysfs
by Eli Qiao
Extended /sys/fs/resctrl sysfs handling such as:
Read string/uint.
Write string.
Create/remove directory.
All these operations will be while we are enabled CAT feature later.
Signed-off-by: Eli Qiao <liyong.qiao(a)intel.com>
---
src/libvirt_private.syms | 9 +++
src/util/virsysfs.c | 143 +++++++++++++++++++++++++++++++++++++++++++++++
src/util/virsysfs.h | 26 +++++++++
src/util/virsysfspriv.h | 1 +
4 files changed, 179 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index b551cb8..f6644cb 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2620,17 +2620,26 @@ virVasprintfInternal;
# util/virsysfs.h
+virSysfsCreateResCtrlDir;
virSysfsGetCpuValueBitmap;
virSysfsGetCpuValueInt;
virSysfsGetCpuValueString;
virSysfsGetCpuValueUint;
virSysfsGetNodeValueBitmap;
virSysfsGetNodeValueString;
+virSysfsGetResctrlInfoString;
+virSysfsGetResctrlInfoUint;
+virSysfsGetResctrlPath;
+virSysfsGetResctrlString;
+virSysfsGetResctrlUint;
virSysfsGetSystemPath;
virSysfsGetValueBitmap;
virSysfsGetValueInt;
virSysfsGetValueString;
+virSysfsRemoveResCtrlDir;
+virSysfsSetResctrlPath;
virSysfsSetSystemPath;
+virSysfsWriteResctrlString;
# util/virsysinfo.h
diff --git a/src/util/virsysfs.c b/src/util/virsysfs.c
index 7a98b48..a17c391 100644
--- a/src/util/virsysfs.c
+++ b/src/util/virsysfs.c
@@ -19,6 +19,7 @@
*/
#include <config.h>
+#include <fcntl.h>
#include "internal.h"
@@ -36,8 +37,10 @@ VIR_LOG_INIT("util.sysfs");
#define VIR_SYSFS_VALUE_MAXLEN 8192
#define SYSFS_SYSTEM_PATH "/sys/devices/system"
+#define SYSFS_RESCTRL_PATH "/sys/fs/resctrl"
static const char *sysfs_system_path = SYSFS_SYSTEM_PATH;
+static const char *sysfs_resctrl_path = SYSFS_RESCTRL_PATH;
void virSysfsSetSystemPath(const char *path)
@@ -55,6 +58,20 @@ virSysfsGetSystemPath(void)
return sysfs_system_path;
}
+void virSysfsSetResctrlPath(const char *path)
+{
+ if (path)
+ sysfs_resctrl_path = path;
+ else
+ sysfs_resctrl_path = SYSFS_RESCTRL_PATH;
+}
+
+const char *
+virSysfsGetResctrlPath(void)
+{
+ return sysfs_resctrl_path;
+}
+
int
virSysfsGetValueInt(const char *file,
int *value)
@@ -227,3 +244,129 @@ virSysfsGetNodeValueBitmap(unsigned int node,
VIR_FREE(path);
return ret;
}
+
+int
+virSysfsGetResctrlString(const char* file,
+ char **value)
+{
+ char *path = NULL;
+ int ret = -1;
+ if (virAsprintf(&path, "%s/%s", sysfs_resctrl_path, file) < 0)
+ return -1;
+
+ if (virFileReadAll(path, VIR_SYSFS_VALUE_MAXLEN, value) < 0)
+ goto cleanup;
+
+ ret = 0;
+
+ cleanup:
+ VIR_FREE(path);
+ return ret;
+}
+
+int
+virSysfsGetResctrlUint(const char *file,
+ unsigned int *value)
+{
+ char *path = NULL;
+ int ret = -1;
+ if (virAsprintf(&path, "%s/%s", sysfs_resctrl_path, file) < 0)
+ return -1;
+
+ ret = virFileReadValueUint(path, value);
+
+ VIR_FREE(path);
+ return ret;
+}
+
+int
+virSysfsGetResctrlInfoString(const char* file,
+ char **value)
+{
+ char *path = NULL;
+ int ret = -1;
+ if (virAsprintf(&path, "%s/info/%s", sysfs_resctrl_path, file) < 0)
+ return -1;
+
+ if (virFileReadAll(path, VIR_SYSFS_VALUE_MAXLEN, value) < 0)
+ goto cleanup;
+
+ ret = 0;
+
+ cleanup:
+ VIR_FREE(path);
+ return ret;
+}
+
+int
+virSysfsGetResctrlInfoUint(const char *file,
+ unsigned int *value)
+{
+ char *path = NULL;
+ int ret;
+
+ if (virAsprintf(&path, "%s/info/%s", sysfs_resctrl_path, file) < 0)
+ return -1;
+
+ ret = virFileReadValueUint(path, value);
+
+ VIR_FREE(path);
+ return ret;
+}
+
+int
+virSysfsWriteResctrlString(const char *file,
+ const char *content)
+{
+ char *path = NULL;
+ int ret = -1;
+ int writefd;
+
+ if (virAsprintf(&path, "%s/%s", sysfs_resctrl_path, file) < 0)
+ return -1;
+
+ /* We can not use virFileWriteStr because resctrl requires oflag should be as
+ O_WRONLY | O_APPEND */
+ if ((writefd = open(path, O_WRONLY | O_APPEND, S_IRUSR | S_IWUSR)) < 0)
+ goto cleanup;
+
+ if (safewrite(writefd, content, strlen(content)) < 0)
+ goto cleanup;
+
+ ret = 0;
+
+ cleanup:
+ VIR_FORCE_CLOSE(writefd);
+ VIR_FREE(path);
+ return ret;
+}
+
+int
+virSysfsCreateResCtrlDir(const char *file)
+{
+ char *path = NULL;
+ int ret = -1;
+
+ if (virAsprintf(&path, "%s/%s", sysfs_resctrl_path, file) < 0)
+ return -1;
+
+ ret = virDirCreate(path, 0755, 0, 0, 0);
+
+ VIR_FREE(path);
+ return ret;
+}
+
+int
+virSysfsRemoveResCtrlDir(const char *file)
+{
+ char *path = NULL;
+ int ret = -1;
+
+ if (virAsprintf(&path, "%s/%s", sysfs_resctrl_path, file) < 0)
+ return -1;
+
+ ret = virFileDeleteTree(path);
+
+ VIR_FREE(path);
+ return ret;
+}
diff --git a/src/util/virsysfs.h b/src/util/virsysfs.h
index cd871ff..60ad444 100644
--- a/src/util/virsysfs.h
+++ b/src/util/virsysfs.h
@@ -25,6 +25,7 @@
# include "virbitmap.h"
const char * virSysfsGetSystemPath(void);
+const char * virSysfsGetResctrlPath(void);
int
virSysfsGetValueInt(const char *file,
@@ -67,4 +68,29 @@ virSysfsGetNodeValueBitmap(unsigned int cpu,
const char *file,
virBitmapPtr *value);
+int
+virSysfsGetResctrlString(const char* file,
+ char **value);
+
+int
+virSysfsGetResctrlUint(const char* file,
+ unsigned int *value);
+
+int
+virSysfsGetResctrlInfoString(const char* file,
+ char **value);
+
+int
+virSysfsGetResctrlInfoUint(const char *file,
+ unsigned int *value);
+
+int
+virSysfsWriteResctrlString(const char *file,
+ const char *content);
+
+int
+virSysfsCreateResCtrlDir(const char *file);
+
+int
+virSysfsRemoveResCtrlDir(const char *file);
#endif /* __VIR_SYSFS_H__*/
diff --git a/src/util/virsysfspriv.h b/src/util/virsysfspriv.h
index ae9f54a..bf36082 100644
--- a/src/util/virsysfspriv.h
+++ b/src/util/virsysfspriv.h
@@ -24,5 +24,6 @@
# include "virsysfs.h"
void virSysfsSetSystemPath(const char *path);
+void virSysfsSetResctrlPath(const char *path);
#endif /* __VIR_SYSFS_PRIV_H__*/
--
1.9.1
7 years, 8 months
[libvirt] Live attaching a disk to a VM fails with apparmor enabled
by Frank Schreuder
Hello,
I'm running libvirt 3.1.0 on a Debian 8 server. I installed apparmor and configured libvirt to use apparmor as security driver.
After booting a VM, virsh dumpxml shows an apparmor seclabel.
As soon as I try to attach a second disk to the VM, apparmor blocks this.
virsh attach-device test-vps /tmp/virshXmlDefinition
error: Failed to attach device from /tmp/virshXmlDefinition
error: operation failed: Could not open '/mnt/images/disk2.raw': Permission denied
Syslogs shows me the following:
Mar 22 17:45:20 vps0 kernel: [1136647.318314] audit: type=1400 audit(1490201120.577:30): apparmor="DENIED" operation="open" profile="libvirt-5747e4db-a3b7-fd69-ca89-00007b0bf859" name="/mnt/images/disk2.raw" pid=13453 comm="kvm" requested_mask="r" denied_mask="r" fsuid=996 ouid=33
Mar 22 17:45:20 vps0 kernel: [1136647.325155] audit: type=1400 audit(1490201120.577:31): apparmor="DENIED" operation="open" profile="libvirt-5747e4db-a3b7-fd69-ca89-00007b0bf859" name="/mnt/images/disk2.raw" pid=13453 comm="kvm" requested_mask="rw" denied_mask="rw" fsuid=996 ouid=33
Mar 22 17:45:20 vps0 libvirtd[10282]: 2017-03-22 16:45:20.596+0000: 10283: error : qemuMonitorTextAddDrive:1968 : operation failed: Could not open '/mnt/images/disk2.raw': Permission denied
In the VM specific apparmor file /etc/apparmor.d/libvirt/libvirt-5747e4db-a3b7-fd69-ca89-00007b0bf859.files I see:
"/mnt/images/disk1.raw" rw,
Which is my primary VM disk, I expected a virsh attach-device to append /mnt/images/disk2.raw to this file and reload/refresh the apparmor profile?
I'm not able to attach a live disk to a running VM with apparmor. Am I missing something? Or is this a bug/missing feature in libvirt?
Thanks,
Frank
7 years, 8 months
[libvirt] seek alternative way of compiling historical version
by Dan
Hi All,
To compile to a non-current version, I could download a tar ball, or switch
to an older branch in git, then do ./autogen.sh (or ./configure) && make
&& make install.
But for some purpose, I may want to compile to historical version easily
without redundantly downloading the source by using some magic flag
passed into either ./configure, ./autogen.sh, or make, e.g.:
$ ./configure --version=2.0, or
$ ./autogen.sh --version-git=1.0
Is that possible at all?
Related question, normally speaking, how to test back-compatibility
of a new patch, or do we need to test it at all?
P.S., I was just reading v0.0.1 libvirt [1].
It is so nice to see there is, well, was nothing more then 2000 LOC
for C source code.
[1] ftp://libvirt.org/libvirt/old/libvir-0.0.1.tar.gz
Dan
7 years, 8 months
[libvirt] Release of libvirt-3.2.0
by Daniel Veillard
As planned I tagged the release in git, the tree is now open for
development. A signed tarball and rpms are available from the usual place:
ftp://libvirt.org/libvirt/
I also made release of the python bindings, libvirt-python-3,2,0 is available
from:
ftp://libvirt.org/libvirt/python/
This new release includes a number of new user visible features as well
as some improvement and bug fixes too:
* New features
- The virt-host-validate tool now supports bhyve hypervisor
- Introduce NVDIMM memory model
NVDIMM is new type of memory introduced into QEMU 2.6. The idea is that
we have a non-volatile memory module that keeps the data persistent
across domain reboots and offers much faster data accesses. However,
due to a bug in QEMU, this feature is not enabled for QEMUs older than
2.9.0.
- qemu: Introduce support for generic PCIe Root Ports
For new controllers, a generic device (pcie-root-port) will be used by
default instead of the Intel-specific device (ioh3420), provided the
QEMU binary supports it.
- qemu: Add support for checking guest CPU ABI compatibility
When migrating a domain to a different host, restoring a domain from a
file or reverting a snapshot libvirt will make sure the guest CPU QEMU
presents to the guest OS exactly matches the one provided on the source
host (or before the domain's state was saved). This enhanced check may
also be requested when starting a new domain to ensure the virtual CPU
exactly matches the one specified in the XML.
- qemu: Add support to migrate using TLS
Add the ability to migrate QEMU guests using TLS via a new flag
VIR_MIGRATE_TLS or virsh migrate '--tls' option. Requires using at
least QEMU 2.9.0 in order to work properly.
- qemu: add mediated devices framework support
Recent kernel version introduced new mediated device framework, so
provide an initial support of this framework for libvirt, mainly by
introducing a new host device type in the XML.
- qemu: Add support for setting TSC frequency
Setting TSC frequency is required to enable migration for domains with
'invtsc' CPU feature turned on.
- Add support for block device threshold event
When using thin provisioning, management tools need to resize the disk
in certain cases. To avoid having them to poll disk usage this version
introduces an event which will be fired when a given offset of the
storage is written by the hypervisor. Together with the API it allows
registering thresholds for given storage backing volumes and this event
will then notify management if the threshold is exceeded. Currently
only the qemu driver supports this.
- bhyve: Add support for UEFI boot ROM, VNC, and USB tablet
The bhyve driver now supports booting using the UEFI boot ROM, so
non-FreeBSD guests that support UEFI could be booted without using an
external boot loader like grub-bhyve. Video is also supported now,
allowing to connect to guests via VNC and use an USB tablet as an input
device. Please refer to the driver page for domain XML examples.
* Improvements
- qemu: Detect host CPU model by asking QEMU on x86_64
Previously, libvirt detected the host CPU model using CPUID
instruction, which caused libvirt to detect a lot of CPU features that
are not supported by QEMU/KVM. Asking QEMU makes sure we don't start it
with unsupported features.
- perf: Add more perf statistics
Add support to get the count of cpu clock time, task clock time, page
faults, context switches, cpu migrations, minor page faults, major page
faults, alignment faults, emulation faults by applications running on
the platform.
- Write hyperv crash information into vm log
qemu's implementation of the hyperv panic notifier now reports
information about the crash from the guest os. Starting with this
version, libvirt logs the information to the vm log file for possible
debugging.
* Bug fixes
- QEMU: Use adaptive timeout for connecting to monitor
When starting qemu, libvirt waits for qemu to create the monitor socket
which libvirt connects to. Historically, there was sharp 30 second
timeout after which the qemu process was killed. This approach is
suboptimal as in some scenarios with huge amounts of guest RAM it can
take a minute or more for kernel to allocate and zero out pages for
qemu. The timeout is now flexible and computed by libvirt at domain
startup.
- Overwrite (clear) 2 KB instead of just 512 bytes when initializing
logical device
- Describe the logical backend requirements better for pool-create-as
Thanks everybody for your help with this release, be it with ideas,
bug reports, patches, reviews, localization, docs ...
Enjoy !
Daniel
--
Daniel Veillard | Red Hat Developers Tools http://developer.redhat.com/
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
7 years, 8 months
[libvirt] [PATCH 00/11] hyperv: add support for Hyper-V 2012 and newer.
by Dawid Zamirski
Hello,
The following patch series reworks the hyper-v driver structs and the
code generator to provide seamless support for both Hyper-V 2008 and
2012 or newer. This does not implement any new libvirt APIs, it just
adapts existing 2008-only driver to also handle 2012 and newer by
sharing as much driver code as possible (currently it's all of it :-))
This is needed to set the foundation before we can move forward with
implementing the rest of the driver APIs.
With 2012 release, Microsoft introduced "v2" version of Msvm_* WMI
classes. Those are largely the same as "v1" (used in 2008) but have some
new properties as well as need different wsman request URIs. To
accomodate those differences, most of work went into the code generator
so that it's "aware" of possibility of multiple versions of the same WMI
class and produce C code accordingly.
To accomplish this the following changes were made:
* hypervPrivate has now wmiVersion field so the driver can check this
at runtime and take appropiate action as needed.
* the abstract hypervObject struct's data member was changed to a union
that has "common", "v1" and "v2" members. Those are structs that
represent WMI classes that we get back from wsman response. The
"common" struct has members that are present in both "v1" and "v2"
which the driver API callbacks can use to read the data from in
version-independent manner (if version-specific member needs to be
accessed the driver can check priv->wmiVersion and read from "v1" or
"v2" as needed). Those structs are guaranteed to be memory aligned
by the code generator (see the _align_propert_members implementation
that takes care of that)
* the generator produces *_WmiInfo for each WMI class "family" that
holds an array of hypervWmiClassInfoPtr each providing information
as to which request URI to use for each "version" of given WMI class
as well as XmlSerializerInfo struct needed to unserilize wsman
responsed into the data structs. The driver uses those to make proper
wsman request depending on which version it's connected to.
* the generator no longer produces "helper" functions such as
hypervGetMsvmComputerSystemList as those were originally just simple
wrappers around hypervEnumAndPull, instead those were hand-written
now (to keep driver changes minimal). The reason is that we'll have
more code coming (once/if this get ACK) implementing missing libvirt
APIs and surely code patterns will emerge that would warrant more
useful "utility" functions like that.
* a hypervInitConnection was added to the driver which "detects"
hyper-v version by testing simple wsman request using v2 then falling
back to v1, obviously if both fail, the we're erroring out.
To express how the above translates in code:
int
hypervImplementSomeLibvirtApi(virConnectPtr conn, ...)
{
hypervPrivate *priv = conn->privateData;
hypervWqlQuery wqlQuery = HYPERV_WQL_QUERY_INITIALIZER;
Msvm_ComputerSystem *list = NULL; /* typed hypervObject instance */
/* the WmiInfo struct has the data needed for wsman request and
* response handling for both v1 and v2 */
wqlQuery.info = Msvm_ComputerSystem_WmiInfo;
wqlQuery.query = "select * from Msvm_ComputerSystem";
if (hypervEnumAndPull(priv, &query, (hypervObject **) &list) < 0) {
goto cleanup;
}
if (list == NULL) {
/* none found */
goto cleanup;
}
/* works with v1 and v2 */
char *vmName = list->data.common->Name;
/* access property that is in v2 only */
if (priv->wmiVersion == HYPERV_WMI_VERSION_V2)
char *foo = list->data.v2->V2Property;
else
char *foo = list->data.v1->V1Property;
}
Dawid Zamirski (11):
hyperv: fixed typo in function name.
hyperv: store WMI version in hypervPrivate.
hyperv: introduce hypervWmiClassInfo struct.
hyperv: update hypervObject struct.
hyperv: add hypervWqlQuery struct.
hyperv: make hypervEnumAndPull use hypervWqlQuery
hyperv: update generator input file.
hyperv: update wmi code generator.
hyperv: add helper for getting WMI class lists.
hyperv: port rest of the driver to new stucts.
hyperv: add hypervInitConnection.
src/Makefile.am | 2 -
src/hyperv/hyperv_driver.c | 168 ++++++++------
src/hyperv/hyperv_private.h | 8 +-
src/hyperv/hyperv_wmi.c | 179 +++++++++++----
src/hyperv/hyperv_wmi.h | 58 ++++-
src/hyperv/hyperv_wmi_classes.h | 30 +++
src/hyperv/hyperv_wmi_generator.input | 239 +++++++++++++++++---
src/hyperv/hyperv_wmi_generator.py | 409 +++++++++++++++++++++++-----------
8 files changed, 809 insertions(+), 284 deletions(-)
mode change 100755 => 100644 src/hyperv/hyperv_wmi_generator.py
--
2.9.3
7 years, 9 months