[packages/virt-what] differenciate between vserver host and guest

glen glen at pld-linux.org
Sat Aug 31 23:43:30 CEST 2013


commit fff4a150af9302c7008fe7f51d2475fd2b2c4fe6
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Sep 1 00:43:19 2013 +0300

    differenciate between vserver host and guest

 virt-what.spec     |  2 ++
 vserver-type.patch | 14 ++++++++++++++
 2 files changed, 16 insertions(+)
---
diff --git a/virt-what.spec b/virt-what.spec
index 17d2a7a..e846157 100644
--- a/virt-what.spec
+++ b/virt-what.spec
@@ -11,6 +11,7 @@ Group:		Applications/Emulators
 Source0:	http://people.redhat.com/~rjones/virt-what/files/%{name}-%{version}.tar.gz
 # Source0-md5:	28d3be1d8981e7fd83c012ebf0d95bb1
 Patch0:		bashisms.patch
+Patch1:		vserver-type.patch
 URL:		http://people.redhat.com/~rjones/virt-what/
 # This is provided by the build root, but we make it explicit
 # anyway in case this was dropped from the build root in future.
@@ -58,6 +59,7 @@ Current types of virtualization detected:
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %configure
diff --git a/vserver-type.patch b/vserver-type.patch
new file mode 100644
index 0000000..2fe09ca
--- /dev/null
+++ b/vserver-type.patch
@@ -0,0 +1,14 @@
+--- virt-what-1.13/virt-what.in	2013-09-01 00:35:37.865167616 +0300
++++ virt-what-1.13/virt-what.in	2013-09-01 00:40:26.000000000 +0300
+@@ -147,6 +147,11 @@
+ # Check for Linux-VServer
+ if cat "${root}/proc/self/status" | grep -q "VxID: [0-9]*"; then
+     echo linux_vserver
++    if grep -q "VxID: 0$" "${root}/proc/self/status"; then
++        echo linux_vserver_host
++    else
++        echo linux_vserver_guest
++    fi
+ fi
+ 
+ # Check for UML.
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/virt-what.git/commitdiff/fff4a150af9302c7008fe7f51d2475fd2b2c4fe6



More information about the pld-cvs-commit mailing list