mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
cpu-gather: Move qemu detection to new script
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
3e04b68ccd
commit
028fc10cb3
@ -77,9 +77,25 @@ def main():
|
||||
metavar="PATH",
|
||||
help="Path to 'cpuid' utility. "
|
||||
"If unset, the first executable 'cpuid' in $PATH is used.")
|
||||
parser.add_argument(
|
||||
"--path-to-qemu",
|
||||
metavar="PATH",
|
||||
help="Path to qemu. "
|
||||
"If unset, will try '/usr/bin/qemu-system-x86_64', "
|
||||
"'/usr/bin/qemu-kvm', and '/usr/libexec/qemu-kvm'.")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.path_to_qemu:
|
||||
args.path_to_qemu = "qemu-system-x86_64"
|
||||
search = [
|
||||
"/usr/bin/qemu-system-x86_64",
|
||||
"/usr/bin/qemu-kvm",
|
||||
"/usr/libexec/qemu-kvm"]
|
||||
for f in search:
|
||||
if os.path.isfile(f):
|
||||
args.path_to_qemu = f
|
||||
|
||||
name = gather_name(args)
|
||||
print("model name\t: {}".format(name))
|
||||
|
||||
@ -97,6 +113,7 @@ def main():
|
||||
|
||||
print(end="", flush=True)
|
||||
os.environ["CPU_GATHER_PY"] = "true"
|
||||
os.environ["qemu"] = args.path_to_qemu
|
||||
subprocess.check_call("./cpu-gather.sh")
|
||||
|
||||
|
||||
|
@ -5,14 +5,6 @@ if [ -z "${CPU_GATHER_PY}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
qemu=qemu-system-x86_64
|
||||
for cmd in /usr/bin/$qemu /usr/bin/qemu-kvm /usr/libexec/qemu-kvm; do
|
||||
if [[ -x $cmd ]]; then
|
||||
qemu=$cmd
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
qom_get()
|
||||
{
|
||||
path='/machine/unattached/device[0]'
|
||||
|
Loading…
x
Reference in New Issue
Block a user