1*cce85725SThomas Huth#!/usr/bin/env python3 2fea374e7SEduardo Habkost# 3fea374e7SEduardo Habkost# Ensure CPU die-id can be omitted on -device 4fea374e7SEduardo Habkost# 5fea374e7SEduardo Habkost# Copyright (c) 2019 Red Hat Inc 6fea374e7SEduardo Habkost# 7fea374e7SEduardo Habkost# Author: 8fea374e7SEduardo Habkost# Eduardo Habkost <ehabkost@redhat.com> 9fea374e7SEduardo Habkost# 10fea374e7SEduardo Habkost# This library is free software; you can redistribute it and/or 11fea374e7SEduardo Habkost# modify it under the terms of the GNU Lesser General Public 12fea374e7SEduardo Habkost# License as published by the Free Software Foundation; either 136a2cd957SGan Qixin# version 2.1 of the License, or (at your option) any later version. 14fea374e7SEduardo Habkost# 15fea374e7SEduardo Habkost# This library is distributed in the hope that it will be useful, 16fea374e7SEduardo Habkost# but WITHOUT ANY WARRANTY; without even the implied warranty of 17fea374e7SEduardo Habkost# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18fea374e7SEduardo Habkost# Lesser General Public License for more details. 19fea374e7SEduardo Habkost# 20fea374e7SEduardo Habkost# You should have received a copy of the GNU Lesser General Public 21fea374e7SEduardo Habkost# License along with this library; if not, see <http://www.gnu.org/licenses/>. 22fea374e7SEduardo Habkost# 23fea374e7SEduardo Habkost 24*cce85725SThomas Huthfrom qemu_test import QemuSystemTest 25fea374e7SEduardo Habkost 262283b627SPhilippe Mathieu-Daudéclass OmittedCPUProps(QemuSystemTest): 27*cce85725SThomas Huth 28fea374e7SEduardo Habkost def test_no_die_id(self): 29fea374e7SEduardo Habkost self.vm.add_args('-nodefaults', '-S') 30fea374e7SEduardo Habkost self.vm.add_args('-smp', '1,sockets=2,cores=2,threads=2,maxcpus=8') 31fea374e7SEduardo Habkost self.vm.add_args('-device', 'qemu64-x86_64-cpu,socket-id=1,core-id=0,thread-id=0') 32fea374e7SEduardo Habkost self.vm.launch() 33861f724dSThomas Huth self.assertEqual(len(self.vm.cmd('query-cpus-fast')), 2) 34*cce85725SThomas Huth 35*cce85725SThomas Huthif __name__ == '__main__': 36*cce85725SThomas Huth QemuSystemTest.main() 37