mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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",
|
metavar="PATH",
|
||||||
help="Path to 'cpuid' utility. "
|
help="Path to 'cpuid' utility. "
|
||||||
"If unset, the first executable 'cpuid' in $PATH is used.")
|
"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()
|
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)
|
name = gather_name(args)
|
||||||
print("model name\t: {}".format(name))
|
print("model name\t: {}".format(name))
|
||||||
|
|
||||||
@ -97,6 +113,7 @@ def main():
|
|||||||
|
|
||||||
print(end="", flush=True)
|
print(end="", flush=True)
|
||||||
os.environ["CPU_GATHER_PY"] = "true"
|
os.environ["CPU_GATHER_PY"] = "true"
|
||||||
|
os.environ["qemu"] = args.path_to_qemu
|
||||||
subprocess.check_call("./cpu-gather.sh")
|
subprocess.check_call("./cpu-gather.sh")
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,14 +5,6 @@ if [ -z "${CPU_GATHER_PY}" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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()
|
qom_get()
|
||||||
{
|
{
|
||||||
path='/machine/unattached/device[0]'
|
path='/machine/unattached/device[0]'
|
||||||
|
Loading…
Reference in New Issue
Block a user