[PATCH 0/2] virSecurityManagerMetadataLock: Ignore RO filesystem
by Michal Privoznik
See 2/2 for explanation.
Michal Prívozník (2):
virSecurityManagerMetadataLock: Clarify directory locking comment
virSecurityManagerMetadataLock: Ignore RO filesystem
src/security/security_manager.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--
2.26.2
4 years, 4 months
[PATCH 0/7] qemu: Stop chowning domain restore file
by Michal Privoznik
See 4/7 for detailed explanation.
Michal Prívozník (7):
security: Reintroduce virSecurityManager{Set,Restore}SavedStateLabel
qemu_security: Implement
virSecurityManager{Set,Restore}SavedStateLabel
security_selinux: Implement
virSecurityManager{Set,Restore}SavedStateLabel
qemu: Use qemuSecuritySetSavedStateLabel() to label restore path
Revert "qemuSecurityDomainRestorePathLabel: Introduce @ignoreNS
argument"
secdrivers: Rename @stdin_path argument of
virSecurityDomainSetAllLabel()
qemu_security: Complete renaming of virSecurityManagerSetAllLabel()
argument
src/libvirt_private.syms | 2 ++
src/qemu/qemu_driver.c | 2 --
src/qemu/qemu_process.c | 12 +++++++
src/qemu/qemu_security.c | 17 +++-------
src/qemu/qemu_security.h | 13 ++++++--
src/security/security_apparmor.c | 8 ++---
src/security/security_dac.c | 2 +-
src/security/security_driver.h | 11 ++++++-
src/security/security_manager.c | 38 ++++++++++++++++++++--
src/security/security_manager.h | 8 ++++-
src/security/security_nop.c | 2 +-
src/security/security_selinux.c | 37 ++++++++++++++++++++-
src/security/security_stack.c | 55 ++++++++++++++++++++++++++++++--
13 files changed, 177 insertions(+), 30 deletions(-)
--
2.26.2
4 years, 4 months
[PATCH] docs: point out that locals should be defined at the top of a block of code
by Laine Stump
Although we have nothing in make syntax-check to enforce this, and
apparently there are places where it isn't the case (according to
Dan), we should discourage the practice of defining new variables in
the middle of a block of code.
https://www.redhat.com/archives/libvir-list/2020-July/msg00433.html
Signed-off-by: Laine Stump <laine(a)redhat.com>
---
docs/coding-style.rst | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/docs/coding-style.rst b/docs/coding-style.rst
index 03b89c86e5..b9b4a16987 100644
--- a/docs/coding-style.rst
+++ b/docs/coding-style.rst
@@ -541,6 +541,44 @@ diligent about this, when you see a non-const pointer, you're
guaranteed that it is used to modify the storage it points to, or
it is aliased to another pointer that is.
+Defining Local Variables
+------------------------
+
+Always define local variables at the top of the block in which they
+are used (before any pure code). Although modern C compilers allow
+defining a local variable in the middle of a block of code, this
+practice can lead to bugs, and must be avoided in all libvirt
+code. (As indicated in these examples, it is okay to initialize
+variables where they are defined, even if the initialization involves
+calling another function.)
+
+::
+
+ GOOD:
+ int
+ Bob(char *loblaw)
+ {
+ int x;
+ int y = lawBlog(loblaw);
+ char *z = NULL;
+
+ x = y + 20;
+ ...
+ }
+
+ BAD:
+ int
+ Bob(char *loblaw)
+ {
+ int x;
+ int y = lawBlog(loblaw);
+
+ x = y + 20;
+
+ char *z = NULL; <===
+ ...
+ }
+
Attribute annotations
---------------------
--
2.25.4
4 years, 4 months
[RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter
by Philippe Mathieu-Daudé
I tried to maintain the SPI mode because it is useful in
tiny embedded devices, and thought it would be helpful for
the AVR MCUs.
As AVR was blocked, I thought it was wise to deprecate the
SPI mode as users are interested in the faster MMC mode.
Today Thomas surprised me by posting an update of it!
https://www.mail-archive.com/qemu-devel@nongnu.org/msg720089.html
I'm still posting this as RFC to discuss, but I'm reconsiderating
keeping this mode a bit more.
Philippe Mathieu-Daudé (2):
hw/sd/ssi-sd: Deprecate the SPI to SD card 'adapter'
hw/sd/sdcard: Deprecate the SPI mode
docs/system/deprecated.rst | 10 ++++++++++
1 file changed, 10 insertions(+)
--
2.21.3
4 years, 4 months
[libvirt PATCH 00/31] fixes and cleanups for current build system
by Pavel Hrdina
While working on rewrite to Meson I discovered some parts of our
current build system that could be improved to help with the
transition to Meson. It will make the review of the Meson patches
a bit easier.
Pavel Hrdina (31):
build: use DLOPEN_LIBS directly
configure: drop check for unsupported FreeBSD
configure: introduce FLAT_NAMESPACE_FLAGS
configure: remove usage of AC_HEADER_MAJOR
Makefile: drop undefined LIB_CLOCK_GETTIME
docs: remove incorrect generated files by apibuild.py
docs: remove unused wrapstring.xsl file
docs: drop %.png: %.fig rule
m4: virt-sanlock: drop check for sanlock_inq_lockspace
m4: virt-sanlock: use pkg-config to find libsanlock_client
m4: virt-sanlock: drop check for SANLK_INQ_WAIT
m4: virt-sanlock: drop check for sanlock_killpath()
m4: virt-sanlock: drop check for sanlock_write_lockspace()
m4: virt-secdriver-selinux: drop obsolete function checks
m4: virt-selinux: drop check for selabel_open signature change
m4: virt-xdr: rewrite XDR check
po: change the format of POTFILES.in
scripts: check-remote-protocol: remove unused OBJEXT argument
src: Makefile: remove LOCK_CHECKING_CFLAGS leftover
src: remove unnecessary -I$(srcdir)/secret include
src: remote: Makefile: drop CFLAGS and LDFLAGS duplication
src: logging: Makefile: drop undefined LOG_DRIVER
src: util: rename some program macros
src: util: Makefile: drop undefined LDEXP_LIBM
src: util: Makefile: drop undefined OPENPTY_LIBS
src: remote: Makefile: properly format sysconfdir in virtproxyd.conf
src: unify virFileActivateDirOverride()
tests: commandhelper: change how we detect if running as daemon
tests: use WITH_NSS instead of NSS
tools: virsh-secret: fix compilation error
tools: wireshark: fix compilation errors
build-aux/syntax-check.mk | 4 +-
configure.ac | 26 +-
docs/Makefile.am | 12 +-
docs/wrapstring.xsl | 56 ---
m4/virt-driver-modules.m4 | 3 -
m4/virt-external-programs.m4 | 8 +-
m4/virt-nss.m4 | 2 +-
m4/virt-sanlock.m4 | 33 +-
m4/virt-secdriver-selinux.m4 | 24 +-
m4/virt-selinux.m4 | 17 -
m4/virt-xdr.m4 | 39 +-
po/Makefile.am | 6 +-
po/POTFILES.in | 726 +++++++++++++--------------
scripts/check-remote-protocol.py | 5 +-
src/Makefile.am | 25 +-
src/admin/Makefile.inc.am | 1 +
src/libvirt.c | 2 +-
src/libvirt_private.syms | 3 +-
src/libxl/Makefile.inc.am | 1 -
src/locking/Makefile.inc.am | 2 +
src/locking/lock_daemon.c | 2 +-
src/locking/lock_driver_sanlock.c | 38 --
src/logging/Makefile.inc.am | 2 +-
src/logging/log_daemon.c | 2 +-
src/qemu/Makefile.inc.am | 1 -
src/qemu/qemu_shim.c | 2 +-
src/remote/Makefile.inc.am | 13 +-
src/remote/remote_daemon.c | 2 +-
src/security/virt-aa-helper.c | 2 +-
src/storage/Makefile.inc.am | 4 -
src/util/Makefile.inc.am | 3 -
src/util/virfile.c | 25 +-
src/util/virfile.h | 4 +-
src/util/virnetdevmidonet.c | 4 +-
src/util/virnetdevopenvswitch.c | 16 +-
tests/Makefile.am | 10 +-
tests/commandhelper.c | 2 +-
tests/nssmock.c | 2 +-
tests/nsstest.c | 2 +-
tests/qemucapsprobe.c | 2 +-
tests/securityselinuxhelper.c | 5 +-
tests/testutils.c | 2 +-
tools/virsh-secret.c | 2 +-
tools/virsh.c | 2 +-
tools/virt-admin.c | 2 +-
tools/wireshark/src/packet-libvirt.c | 19 +-
46 files changed, 472 insertions(+), 693 deletions(-)
delete mode 100644 docs/wrapstring.xsl
--
2.26.2
4 years, 4 months
libvirt opens kernel+initrd in read-write mode
by Olaf Hering
Is there a reason why libvirtd v6.5.0 opens kernel+initrd in mode RW?
'virsh start vm' fails of both are on a read-only filesystem.
Not sure if this ever worked before.
<domain type='kvm'>
<os>
<type arch='x86_64' machine='pc-i440fx-5.1'>hvm</type>
<kernel>/path/to/kernel</kernel>
<initrd>/path/to/initrd</initrd>
<cmdline>net.ifnames=0 console=ttyS0,115200 linemode=1 panic=9 start_shell</cmdline>
<boot dev='hd'/>
</os>
</domain>
....
13111 stat("/path/to/initrd", {st_mode=S_IFREG|0755, st_size=119207064, ...}) = 0
13111 openat(AT_FDCWD, "/path/to/initrd", O_RDWR) = -1 EROFS (Read-only file system)
....
Olaf
4 years, 4 months
[libvirt PATCH] All pointers to virXMLPropString() use g_autofree.
by Nicolas Brignone
All modified functions are similar, in all cases "cleanup" label is removed,
along with all the "goto" calls.
Signed-off-by: Nicolas Brignone <nmbrignone(a)gmail.com>
---
src/conf/device_conf.c | 183 +++++++++++++----------------------------
1 file changed, 56 insertions(+), 127 deletions(-)
diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c
index 7d48a3f..9fa6141 100644
--- a/src/conf/device_conf.c
+++ b/src/conf/device_conf.c
@@ -208,45 +208,43 @@ int
virPCIDeviceAddressParseXML(xmlNodePtr node,
virPCIDeviceAddressPtr addr)
{
- char *domain, *slot, *bus, *function, *multi;
xmlNodePtr cur;
xmlNodePtr zpci = NULL;
- int ret = -1;
memset(addr, 0, sizeof(*addr));
- domain = virXMLPropString(node, "domain");
- bus = virXMLPropString(node, "bus");
- slot = virXMLPropString(node, "slot");
- function = virXMLPropString(node, "function");
- multi = virXMLPropString(node, "multifunction");
+ g_autofree char *domain = virXMLPropString(node, "domain");
+ g_autofree char *bus = virXMLPropString(node, "bus");
+ g_autofree char *slot = virXMLPropString(node, "slot");
+ g_autofree char *function = virXMLPropString(node, "function");
+ g_autofree char *multi = virXMLPropString(node, "multifunction");
if (domain &&
virStrToLong_uip(domain, NULL, 0, &addr->domain) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'domain' attribute"));
- goto cleanup;
+ return -1;
}
if (bus &&
virStrToLong_uip(bus, NULL, 0, &addr->bus) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'bus' attribute"));
- goto cleanup;
+ return -1;
}
if (slot &&
virStrToLong_uip(slot, NULL, 0, &addr->slot) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'slot' attribute"));
- goto cleanup;
+ return -1;
}
if (function &&
virStrToLong_uip(function, NULL, 0, &addr->function) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'function' attribute"));
- goto cleanup;
+ return -1;
}
if (multi &&
@@ -254,11 +252,11 @@ virPCIDeviceAddressParseXML(xmlNodePtr node,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unknown value '%s' for <address> 'multifunction' attribute"),
multi);
- goto cleanup;
+ return -1;
}
if (!virPCIDeviceAddressIsEmpty(addr) && !virPCIDeviceAddressIsValid(addr, true))
- goto cleanup;
+ return -1;
cur = node->children;
while (cur) {
@@ -270,17 +268,9 @@ virPCIDeviceAddressParseXML(xmlNodePtr node,
}
if (zpci && virZPCIDeviceAddressParseXML(zpci, addr) < 0)
- goto cleanup;
+ return -1;
- ret = 0;
-
- cleanup:
- VIR_FREE(domain);
- VIR_FREE(bus);
- VIR_FREE(slot);
- VIR_FREE(function);
- VIR_FREE(multi);
- return ret;
+ return 0;
}
void
@@ -309,187 +299,149 @@ int
virDomainDeviceCCWAddressParseXML(xmlNodePtr node,
virDomainDeviceCCWAddressPtr addr)
{
- int ret = -1;
- char *cssid;
- char *ssid;
- char *devno;
-
memset(addr, 0, sizeof(*addr));
- cssid = virXMLPropString(node, "cssid");
- ssid = virXMLPropString(node, "ssid");
- devno = virXMLPropString(node, "devno");
+ g_autofree char *cssid = virXMLPropString(node, "cssid");
+ g_autofree char *ssid = virXMLPropString(node, "ssid");
+ g_autofree char *devno = virXMLPropString(node, "devno");
if (cssid && ssid && devno) {
if (cssid &&
virStrToLong_uip(cssid, NULL, 0, &addr->cssid) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'cssid' attribute"));
- goto cleanup;
+ return -1;
}
if (ssid &&
virStrToLong_uip(ssid, NULL, 0, &addr->ssid) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'ssid' attribute"));
- goto cleanup;
+ return -1;
}
if (devno &&
virStrToLong_uip(devno, NULL, 0, &addr->devno) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'devno' attribute"));
- goto cleanup;
+ return -1;
}
if (!virDomainDeviceCCWAddressIsValid(addr)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid specification for virtio ccw"
" address: cssid='%s' ssid='%s' devno='%s'"),
cssid, ssid, devno);
- goto cleanup;
+ return -1;
}
addr->assigned = true;
} else if (cssid || ssid || devno) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Invalid partial specification for virtio ccw"
" address"));
- goto cleanup;
+ return -1;
}
- ret = 0;
-
- cleanup:
- VIR_FREE(cssid);
- VIR_FREE(ssid);
- VIR_FREE(devno);
- return ret;
+ return 0;
}
int
virDomainDeviceDriveAddressParseXML(xmlNodePtr node,
virDomainDeviceDriveAddressPtr addr)
{
- char *bus, *unit, *controller, *target;
- int ret = -1;
-
memset(addr, 0, sizeof(*addr));
- controller = virXMLPropString(node, "controller");
- bus = virXMLPropString(node, "bus");
- target = virXMLPropString(node, "target");
- unit = virXMLPropString(node, "unit");
+ g_autofree char *controller = virXMLPropString(node, "controller");
+ g_autofree char *bus = virXMLPropString(node, "bus");
+ g_autofree char *target = virXMLPropString(node, "target");
+ g_autofree char *unit = virXMLPropString(node, "unit");
if (controller &&
virStrToLong_uip(controller, NULL, 10, &addr->controller) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'controller' attribute"));
- goto cleanup;
+ return -1;
}
if (bus &&
virStrToLong_uip(bus, NULL, 10, &addr->bus) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'bus' attribute"));
- goto cleanup;
+ return -1;
}
if (target &&
virStrToLong_uip(target, NULL, 10, &addr->target) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'target' attribute"));
- goto cleanup;
+ return -1;
}
if (unit &&
virStrToLong_uip(unit, NULL, 10, &addr->unit) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'unit' attribute"));
- goto cleanup;
+ return -1;
}
- ret = 0;
-
- cleanup:
- VIR_FREE(controller);
- VIR_FREE(bus);
- VIR_FREE(target);
- VIR_FREE(unit);
- return ret;
+ return 0;
}
int
virDomainDeviceVirtioSerialAddressParseXML(xmlNodePtr node,
virDomainDeviceVirtioSerialAddressPtr addr)
{
- char *controller, *bus, *port;
- int ret = -1;
-
memset(addr, 0, sizeof(*addr));
- controller = virXMLPropString(node, "controller");
- bus = virXMLPropString(node, "bus");
- port = virXMLPropString(node, "port");
+ g_autofree char *controller = virXMLPropString(node, "controller");
+ g_autofree char *bus = virXMLPropString(node, "bus");
+ g_autofree char *port = virXMLPropString(node, "port");
if (controller &&
virStrToLong_uip(controller, NULL, 10, &addr->controller) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'controller' attribute"));
- goto cleanup;
+ return -1;
}
if (bus &&
virStrToLong_uip(bus, NULL, 10, &addr->bus) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'bus' attribute"));
- goto cleanup;
+ return -1;
}
if (port &&
virStrToLong_uip(port, NULL, 10, &addr->port) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'port' attribute"));
- goto cleanup;
+ return -1;
}
- ret = 0;
-
- cleanup:
- VIR_FREE(controller);
- VIR_FREE(bus);
- VIR_FREE(port);
- return ret;
+ return 0;
}
int
virDomainDeviceCcidAddressParseXML(xmlNodePtr node,
virDomainDeviceCcidAddressPtr addr)
{
- char *controller, *slot;
- int ret = -1;
-
memset(addr, 0, sizeof(*addr));
- controller = virXMLPropString(node, "controller");
- slot = virXMLPropString(node, "slot");
+ g_autofree char *controller = virXMLPropString(node, "controller");
+ g_autofree char *slot = virXMLPropString(node, "slot");
if (controller &&
virStrToLong_uip(controller, NULL, 10, &addr->controller) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'controller' attribute"));
- goto cleanup;
+ return -1;
}
if (slot &&
virStrToLong_uip(slot, NULL, 10, &addr->slot) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'slot' attribute"));
- goto cleanup;
+ return -1;
}
- ret = 0;
-
- cleanup:
- VIR_FREE(controller);
- VIR_FREE(slot);
- return ret;
+ return 0;
}
static int
@@ -519,57 +471,41 @@ int
virDomainDeviceUSBAddressParseXML(xmlNodePtr node,
virDomainDeviceUSBAddressPtr addr)
{
- char *port, *bus;
- int ret = -1;
memset(addr, 0, sizeof(*addr));
- port = virXMLPropString(node, "port");
- bus = virXMLPropString(node, "bus");
+ g_autofree char *port = virXMLPropString(node, "port");
+ g_autofree char *bus = virXMLPropString(node, "bus");
if (port && virDomainDeviceUSBAddressParsePort(addr, port) < 0)
- goto cleanup;
+ return -1;
if (bus &&
virStrToLong_uip(bus, NULL, 10, &addr->bus) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'bus' attribute"));
- goto cleanup;
+ return -1;
}
-
- ret = 0;
-
- cleanup:
- VIR_FREE(bus);
- VIR_FREE(port);
- return ret;
+ return 0;
}
int
virDomainDeviceSpaprVioAddressParseXML(xmlNodePtr node,
virDomainDeviceSpaprVioAddressPtr addr)
{
- char *reg;
- int ret;
-
memset(addr, 0, sizeof(*addr));
- reg = virXMLPropString(node, "reg");
+ g_autofree char *reg = virXMLPropString(node, "reg");
if (reg) {
if (virStrToLong_ull(reg, NULL, 16, &addr->reg) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot parse <address> 'reg' attribute"));
- ret = -1;
- goto cleanup;
+ return -1;
}
addr->has_reg = true;
}
-
- ret = 0;
- cleanup:
- VIR_FREE(reg);
- return ret;
+ return 0;
}
bool
@@ -604,19 +540,17 @@ int
virInterfaceLinkParseXML(xmlNodePtr node,
virNetDevIfLinkPtr lnk)
{
- int ret = -1;
- char *stateStr, *speedStr;
int state;
- stateStr = virXMLPropString(node, "state");
- speedStr = virXMLPropString(node, "speed");
+ g_autofree char *stateStr = virXMLPropString(node, "state");
+ g_autofree char *speedStr = virXMLPropString(node, "speed");
if (stateStr) {
if ((state = virNetDevIfStateTypeFromString(stateStr)) < 0) {
virReportError(VIR_ERR_XML_ERROR,
_("unknown link state: %s"),
stateStr);
- goto cleanup;
+ return -1;
}
lnk->state = state;
}
@@ -626,14 +560,9 @@ virInterfaceLinkParseXML(xmlNodePtr node,
virReportError(VIR_ERR_XML_ERROR,
_("Unable to parse link speed: %s"),
speedStr);
- goto cleanup;
+ return -1;
}
-
- ret = 0;
- cleanup:
- VIR_FREE(stateStr);
- VIR_FREE(speedStr);
- return ret;
+ return 0;
}
int
--
2.25.2
4 years, 4 months
[libvirt PATCH] docs: kbase: Fix the libvirt-host-validate typo
by Erik Skultety
I overlooked this typo during review of 2c3ffa37.
Reported-by: Yalan Zhang <yalzhang(a)redhat.com>
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
Pushed as trivial.
docs/kbase/launch_security_sev.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/kbase/launch_security_sev.rst b/docs/kbase/launch_security_sev.rst
index 19b978481a..cfdc2a6120 100644
--- a/docs/kbase/launch_security_sev.rst
+++ b/docs/kbase/launch_security_sev.rst
@@ -30,7 +30,7 @@ Enabling SEV on the host
========================
Before VMs can make use of the SEV feature you need to make sure your
-AMD CPU does support SEV. You can run ``libvirt-host-validate``
+AMD CPU does support SEV. You can run ``virt-host-validate``
(libvirt >= 6.5.0) to check if your host supports secure guests or you
can follow the manual checks below.
--
2.26.2
4 years, 4 months
[PATCH] cpu_arm: fix build on non-Linux
by Roman Bogorodskiy
- Add a check for asm/hwcap.h header presence,
- Add a check for getauxval() function that is used
on Linux, and for elf_aux_info() which is a FreeBSD
equivalent.
This is based on a patch submitted by Mikael Urankar in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247722.
Signed-off-by: Roman Bogorodskiy <bogorodskiy(a)gmail.com>
---
configure.ac | 3 +++
src/cpu/cpu_arm.c | 12 +++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 79055db9b1..40a326c1aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -345,7 +345,9 @@ AC_CHECK_SIZEOF([long])
dnl Availability of various common functions (non-fatal if missing),
dnl and various less common threadsafe functions
AC_CHECK_FUNCS_ONCE([\
+ elf_aux_info \
fallocate \
+ getauxval \
getegid \
geteuid \
getgid \
@@ -374,6 +376,7 @@ AC_CHECK_FUNCS_ONCE([\
dnl Availability of various common headers (non-fatal if missing).
AC_CHECK_HEADERS([\
+ asm/hwcap.h \
ifaddrs.h \
libtasn1.h \
util.h \
diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c
index cd4f720c95..fbc363e9c7 100644
--- a/src/cpu/cpu_arm.c
+++ b/src/cpu/cpu_arm.c
@@ -22,7 +22,9 @@
#include <config.h>
#if defined(__aarch64__)
-# include <asm/hwcap.h>
+# if defined(HAVE_ASM_HWCAP_H)
+# include <asm/hwcap.h>
+# endif
# include <sys/auxv.h>
#endif
@@ -518,11 +520,13 @@ virCPUarmCpuDataFromRegs(virCPUarmData *data)
int cpu_feature_index = 0;
size_t i;
+# if defined(HAVE_GETAUXVAL)
if (!(getauxval(AT_HWCAP) & HWCAP_CPUID)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("CPUID registers unavailable"));
return -1;
}
+# endif
/* read the cpuid data from MIDR_EL1 register */
asm("mrs %0, MIDR_EL1" : "=r" (cpuid));
@@ -533,7 +537,13 @@ virCPUarmCpuDataFromRegs(virCPUarmData *data)
/* parse the coresponding vendor_id bits */
data->vendor_id = (cpuid >> 24) & 0xff;
+# if defined(HAVE_GETAUXVAL)
hwcaps = getauxval(AT_HWCAP);
+# elif defined(HAVE_ELF_AUX_INFO)
+ elf_aux_info(AT_HWCAP, &hwcaps, sizeof(u_long));
+# else
+# error No routines to retrieve a value from the auxiliary vector
+# endif
VIR_DEBUG("CPU flags read from register: 0x%016lx", hwcaps);
features = g_new0(char *, MAX_CPU_FLAGS + 1);
--
2.27.0
4 years, 4 months
[PATCHv2] Add a changelog entry for the esx NIC limit changes
by Bastien Orivel
This was forgotten in 4bd375b6ce3a4c134bab19cd7c9a7a83609547c8
Signed-off-by: Bastien Orivel <bastien.orivel(a)diateam.net>
---
NEWS.rst | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index cc35cb26b2..1928220854 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -20,6 +20,11 @@ v6.6.0 (unreleased)
* **Improvements**
+ * esx: Change the NIC limit for recent virtualHW versions
+
+ Specifying a virtualHW version greater or equal to 7 (ESXi 4.0) will allow
+ you to use up to 10 NICs instead of 4 as it was previously.
+
* **Bug fixes**
--
2.20.1
4 years, 4 months