Re: [systemd-devel] [PATCH 0/2] arm/aarch64: detect-virt: check dmi

2015-11-04 Thread Andrew Jones
On Tue, Nov 03, 2015 at 10:50:40PM -0600, Wei Huang wrote: > > > On 11/03/2015 03:19 PM, Andrew Jones wrote: > > ARM/AArch64 guests now have SMBIOS tables populated (when boot > > with a late enough QEMU and a late enough AAVMF is used as the > > bootloader). Fu

Re: [systemd-devel] [PATCH 1/2] detect-virt: detect in best-heuristic order

2015-11-04 Thread Andrew Jones
On Wed, Nov 04, 2015 at 03:54:45PM +0300, Andrei Borzenkov wrote: > 04.11.2015 00:04, Andrew Jones пишет: > >afaict, this will fix a regression caused by commit 75f86906c5. > >Where we used to report "kvm" before that patch, without this patch, > >we would only r

Re: [systemd-devel] [PATCH 1/2] arm/aarch64: detect-virt: check dmi

2015-11-04 Thread Andrew Jones
On Wed, Nov 04, 2015 at 11:52:03AM +0100, Lennart Poettering wrote: > On Tue, 03.11.15 15:19, Andrew Jones (drjo...@redhat.com) wrote: > > > --- > > src/basic/virt.c | 6 ++ > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a

Re: [systemd-devel] [PATCH 0/2] arm/aarch64: detect-virt: check dmi

2015-11-04 Thread Andrew Jones
On Wed, Nov 04, 2015 at 11:51:10AM +0100, Lennart Poettering wrote: > On Tue, 03.11.15 15:19, Andrew Jones (drjo...@redhat.com) wrote: > > > ARM/AArch64 guests now have SMBIOS tables populated (when boot > > with a late enough QEMU and a late enough AAVMF is used as

Re: [systemd-devel] [PATCH 2/2] detect-virt: dmi: fix mem leak

2015-11-04 Thread Andrew Jones
On Wed, Nov 04, 2015 at 11:46:22AM +0100, Lennart Poettering wrote: > On Tue, 03.11.15 15:04, Andrew Jones (drjo...@redhat.com) wrote: > > > The variable 's' is still in scope until we exit the function. We > > can't call read_one_line_file on it multiple times without calling &

Re: [systemd-devel] [PATCH 2/2] detect-virt: dmi: fix mem leak

2015-11-04 Thread Andrew Jones
On Wed, Nov 04, 2015 at 08:26:00AM -0600, Andrew Jones wrote: > On Wed, Nov 04, 2015 at 11:46:22AM +0100, Lennart Poettering wrote: > > On Tue, 03.11.15 15:04, Andrew Jones (drjo...@redhat.com) wrote: > > > > > The variable 's' is still in scope until we exit the funct

[systemd-devel] [PATCH 2/2] detect-virt: dmi: look for KVM

2015-11-03 Thread Andrew Jones
Some guests (ARM, AArch64, x86-RHEL) have 'KVM' in the product name. Look for that first in order to more precisely report "kvm" when detecting a QEMU/KVM guest. Without this patch we report "qemu", even if KVM acceleration is in use on ARM/AArch64 guests. --- src/basic/virt.c | 2 ++ 1 file

[systemd-devel] [PATCH 2/2] detect-virt: dmi: fix mem leak

2015-11-03 Thread Andrew Jones
The variable 's' is still in scope until we exit the function. We can't call read_one_line_file on it multiple times without calling free in between. --- src/basic/virt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/basic/virt.c b/src/basic/virt.c index

[systemd-devel] [PATCH 0/2] detect-virt: fixes

2015-11-03 Thread Andrew Jones
These fixes are untested, as I don't have a good test environment for systemd. I noticed the issues in the code while preparing a couple patches (which are coming shortly). Andrew Jones (2): detect-virt: detect in best-heuristic order detect-virt: dmi: fix mem leak src/basic/virt.c | 21

[systemd-devel] [PATCH 1/2] detect-virt: detect in best-heuristic order

2015-11-03 Thread Andrew Jones
afaict, this will fix a regression caused by commit 75f86906c5. Where we used to report "kvm" before that patch, without this patch, we would only report "qemu". The reason is because cpuid detection must come before dmi detection. Also, both can safely come before other xen heuristics. ---

[systemd-devel] [PATCH 1/2] arm/aarch64: detect-virt: check dmi

2015-11-03 Thread Andrew Jones
--- src/basic/virt.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/basic/virt.c b/src/basic/virt.c index fb181e5b55ee5..b0e33dc5f4d24 100644 --- a/src/basic/virt.c +++ b/src/basic/virt.c @@ -34,7 +34,7 @@ static int detect_vm_cpuid(void) { -/* Both

[systemd-devel] [PATCH 0/2] arm/aarch64: detect-virt: check dmi

2015-11-03 Thread Andrew Jones
). Of course it would be nice to get regression testing on all guest types that depend on dmi done. Andrew Jones (2): arm/aarch64: detect-virt: check dmi detect-virt: dmi: look for KVM src/basic/virt.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.4.3

Re: [systemd-devel] [PATCH 3/3] ARM: detect-virt: detect QEMU/KVM

2015-03-31 Thread Andrew Jones
On Tue, Mar 31, 2015 at 09:18:08AM +0200, Lennart Poettering wrote: On Mon, 30.03.15 21:15, Andrew Jones (drjo...@redhat.com) wrote: QEMU/KVM guests do not have hypervisor nodes, but they do have fw-cfg nodes (since qemu v2.3.0-rc0). fw-cfg nodes are documented, see kernel doc

[systemd-devel] [PATCH v2 2/3] ARM: detect-virt: detect Xen

2015-03-31 Thread Andrew Jones
--- src/shared/virt.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/shared/virt.c b/src/shared/virt.c index aa3501f42916c..712523210d720 100644 --- a/src/shared/virt.c +++ b/src/shared/virt.c @@ -102,7 +102,7 @@ static int detect_vm_cpuid(const char **_id) { }

[systemd-devel] [PATCH v2 1/3] detect-virt: use /proc/device-tree

2015-03-31 Thread Andrew Jones
Kernel doc Documentation/ABI/testing/sysfs-firmware-ofw says that the /proc/device-tree symlink should be used, as opposed to directly accessing /sys/firmware/devicetree/base. The former is ABI, but not the later. --- src/shared/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[systemd-devel] [PATCH v2 0/3] [RFT] ARM: detect-virt: detect Xen and QEMU/KVM

2015-03-31 Thread Andrew Jones
to an older version. Thanks for reviews and testing. Please keep me on CC as I'm not subscribed to the list. drew Changes since v1 [Lennart Poettering]: - propagate errors from detect_vm_devicetree - use FOREACH_DIRENT Andrew Jones (3): detect-virt: use /proc/device-tree ARM: detect-virt: detect

[systemd-devel] [PATCH v2 3/3] ARM: detect-virt: detect QEMU/KVM

2015-03-31 Thread Andrew Jones
QEMU/KVM guests do not have hypervisor nodes, but they do have fw-cfg nodes (since qemu v2.3.0-rc0). fw-cfg nodes are documented, see kernel doc Documentation/devicetree/bindings/arm/fw-cfg.txt, and therefore we should be able to rely on it in this detection. Unfortunately, we currently don't

Re: [systemd-devel] [PATCH 0/3] [RFT] ARM: detect-virt: detect Xen and QEMU/KVM

2015-03-30 Thread Andrew Jones
On Mon, Mar 30, 2015 at 09:15:52PM +0200, Andrew Jones wrote: This series adds support for detecting if an arm or aarch64 deployment is a Xen or QEMU/KVM guest. I've tested the QEMU/KVM detection on an AArch64 guest. The Xen detection has *not* been tested, thus the RFT. I should