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