Lines Matching +full:- +full:chs

10  * See the COPYING file in the top-level directory.
24 #include "standard-headers/linux/qemu_fw_cfg.h"
64 [backend_empty] = -1,
86 return expected_chst && expected_chst->cyls; in is_hd()
120 int c = expected_chst->cyls; in test_cmos_drive_cyl()
121 int h = expected_chst->heads; in test_cmos_drive_cyl()
122 int s = expected_chst->secs; in test_cmos_drive_cyl()
156 val |= cur_ide[i]->trans << (2 * i); in test_cmos_disktransflag()
183 g_strdup("-nodefaults")); in setup_common()
185 g_strdup("-machine")); in setup_common()
194 /* chs 0,1,1 (lba 63) to chs 0,127,63 (8001 sectors) */ in setup_mbr()
198 /* chs 0,1,1 (lba 63) to chs 7,15,63 (8001 sectors) */ in setup_mbr()
225 s1 = g_strdup_printf("-drive id=drive%d,if=%s", in setup_ide()
243 g_strdup_printf("-device %s,drive=drive%d," in setup_ide()
281 dev = use_device ? (is_hd(cur_ide[i]) ? "ide-hd" : "ide-cd") : NULL; in test_ide_mbr()
309 * Test case: IDE devices (if=ide) with MBRs indicating CHS is in use
333 * Test case: IDE devices (if=none) with MBRs indicating CHS is in use
351 dev, trans ? "bios-chs-trans=lba," : "", in test_ide_drive_user()
366 * Test case: IDE device (if=none) with explicit CHS
370 test_ide_drive_user("ide-hd", false); in test_ide_device_user_chs()
374 * Test case: IDE device (if=none) with explicit CHS and translation
378 test_ide_drive_user("ide-hd", true); in test_ide_device_user_chst()
382 * Test case: IDE devices (if=ide), but use index=0 for CD-ROM
394 ide_idx = backend_empty - i; in test_ide_drive_cd_0()
490 "%s convert -f raw -O qcow2 %s %s > /dev/null", in create_qcow2_with_mbr()
518 } CHS; typedef
522 CHS chs; member
535 qfw_cfg_get_file(fw_cfg, "bios-geometry", buf, BIOS_GEOMETRY_MAX_SIZE); in read_bootdevices()
547 r->dev_path = g_malloc0(strlen(cur) + 1); in read_bootdevices()
549 (char *)r->dev_path, in read_bootdevices()
550 &(r->chs.c), &(r->chs.h), &(r->chs.s)); in read_bootdevices()
565 r = cur_result->data; in read_bootdevices()
566 if (!strcmp(r->dev_path, expected[i].dev_path) && in read_bootdevices()
567 !memcmp(&(r->chs), &(expected[i].chs), sizeof(r->chs))) { in read_bootdevices()
574 g_free((char *)((CHSResult *)cur_result->data)->dev_path); in read_bootdevices()
575 g_free(cur_result->data); in read_bootdevices()
600 args->argv = g_new0(char *, ARGV_SIZE); in create_args()
601 args->argc = append_arg(args->argc, args->argv, in create_args()
602 ARGV_SIZE, g_strdup("-nodefaults")); in create_args()
603 args->drives = g_new0(char *, MAX_DRIVES); in create_args()
614 g_assert(args->n_drives < MAX_DRIVES); in add_drive_with_mbr()
618 args->drives[args->n_drives] = img_file_name; in add_drive_with_mbr()
620 "-drive file=%s,if=none,format=qcow2,id=disk%d", in add_drive_with_mbr()
621 img_file_name, args->n_drives); in add_drive_with_mbr()
623 args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, g_strdup(part)); in add_drive_with_mbr()
624 args->n_drives++; in add_drive_with_mbr()
634 "-device ide-hd,drive=disk%d,bus=ide.%d,unit=%d," in add_ide_disk()
638 args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, g_strdup(part)); in add_ide_disk()
650 "-device %s,id=scsi%d,bus=%s,addr=%d", in add_scsi_controller()
651 type, args->n_scsi_controllers, bus, addr); in add_scsi_controller()
653 args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, g_strdup(part)); in add_scsi_controller()
654 args->n_scsi_controllers++; in add_scsi_controller()
666 "-device scsi-hd,id=scsi-disk%d,drive=disk%d," in add_scsi_disk()
668 "channel=%d,scsi-id=%d,lun=%d," in add_scsi_disk()
670 args->n_scsi_disks, drive_idx, bus, channel, scsi_id, lun, in add_scsi_disk()
673 args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, g_strdup(part)); in add_scsi_disk()
674 args->n_scsi_disks++; in add_scsi_disk()
685 "-device virtio-blk-pci,id=virtio-disk%d," in add_virtio_disk()
688 args->n_virtio_disks, drive_idx, bus, addr, c, h, s); in add_virtio_disk()
690 args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, g_strdup(part)); in add_virtio_disk()
691 args->n_virtio_disks++; in add_virtio_disk()
702 joined_args = g_strjoinv(" ", args->argv); in test_override()
704 qts = qtest_initf("-machine %s %s", arch, joined_args); in test_override()
714 for (i = 0; i < args->n_drives; i++) { in test_override()
715 unlink(args->drives[i]); in test_override()
716 g_free(args->drives[i]); in test_override()
718 g_free(args->drives); in test_override()
719 g_strfreev(args->argv); in test_override()
791 br = g_strdup_printf("-device pcie-pci-bridge,bus=pcie.0,id=%s", id); in setup_pci_bridge()
793 args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, br); in setup_pci_bridge()
800 { "/pci@i0cf8/pci-bridge@1/scsi@3/channel@0/disk@0,0", in test_override_scsi_q35()
803 {"/pci@i0cf8/pci-bridge@1/scsi@3/channel@0/disk@1,0", {9000, 120, 30} }, in test_override_scsi_q35()
804 {"/pci@i0cf8/pci-bridge@1/scsi@3/channel@0/disk@2,0", {1, 0, 0} }, in test_override_scsi_q35()
805 {"/pci@i0cf8/pci-bridge@1/scsi@3/channel@0/disk@3,0", {0, 1, 0} }, in test_override_scsi_q35()
812 setup_pci_bridge(args, "pcie-pci-br"); in test_override_scsi_q35()
813 add_scsi_controller(args, "lsi53c895a", "pcie-pci-br", 3); in test_override_scsi_q35()
836 add_scsi_controller(args, "virtio-scsi-pci", "pci.0", 4); in test_override_scsi_2_controllers()
863 {"/pci@i0cf8/pci-bridge@1/scsi@3/disk@0,0", {10000, 120, 30} }, in test_override_virtio_blk_q35()
864 {"/pci@i0cf8/pci-bridge@1/scsi@4/disk@0,0", {9000, 120, 30} }, in test_override_virtio_blk_q35()
869 setup_pci_bridge(args, "pcie-pci-br"); in test_override_virtio_blk_q35()
870 add_virtio_disk(args, 0, "pcie-pci-br", 3, 10000, 120, 30); in test_override_virtio_blk_q35()
871 add_virtio_disk(args, 1, "pcie-pci-br", 4, 9000, 120, 30); in test_override_virtio_blk_q35()
906 joined_args = g_strjoinv(" ", args->argv); in test_override_hot_unplug()
931 for (i = 0; i < args->n_drives; i++) { in test_override_hot_unplug()
932 unlink(args->drives[i]); in test_override_hot_unplug()
933 g_free(args->drives[i]); in test_override_hot_unplug()
935 g_free(args->drives); in test_override_hot_unplug()
936 g_strfreev(args->argv); in test_override_hot_unplug()
954 add_scsi_controller(args, "virtio-scsi-pci", "pci.0", 2); in test_override_scsi_hot_unplug()
958 args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, in test_override_scsi_hot_unplug()
959 g_strdup("-machine pc")); in test_override_scsi_hot_unplug()
961 test_override_hot_unplug(args, "scsi-disk0", expected, expected2); in test_override_scsi_hot_unplug()
969 "/pci@i0cf8/pci-bridge@1/pci-bridge@0/scsi@2/channel@0/disk@0,0", in test_override_scsi_hot_unplug_q35()
973 "/pci@i0cf8/pci-bridge@1/pci-bridge@0/scsi@2/channel@0/disk@1,0", in test_override_scsi_hot_unplug_q35()
980 "/pci@i0cf8/pci-bridge@1/pci-bridge@0/scsi@2/channel@0/disk@1,0", in test_override_scsi_hot_unplug_q35()
986 args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, in test_override_scsi_hot_unplug_q35()
987 g_strdup("-device pcie-root-port,id=p0 " in test_override_scsi_hot_unplug_q35()
988 "-device pcie-pci-bridge,bus=p0,id=b1 " in test_override_scsi_hot_unplug_q35()
989 "-machine q35")); in test_override_scsi_hot_unplug_q35()
993 add_scsi_controller(args, "virtio-scsi-pci", "b1", 2); in test_override_scsi_hot_unplug_q35()
997 test_override_hot_unplug(args, "scsi-disk0", expected, expected2); in test_override_scsi_hot_unplug_q35()
1017 args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, in test_override_virtio_hot_unplug()
1018 g_strdup("-machine pc")); in test_override_virtio_hot_unplug()
1020 test_override_hot_unplug(args, "virtio-disk0", expected, expected2); in test_override_virtio_hot_unplug()
1028 "/pci@i0cf8/pci-bridge@1/pci-bridge@0/scsi@2/disk@0,0", in test_override_virtio_hot_unplug_q35()
1032 "/pci@i0cf8/pci-bridge@1/pci-bridge@0/scsi@3/disk@0,0", in test_override_virtio_hot_unplug_q35()
1039 "/pci@i0cf8/pci-bridge@1/pci-bridge@0/scsi@3/disk@0,0", in test_override_virtio_hot_unplug_q35()
1045 args->argc = append_arg(args->argc, args->argv, ARGV_SIZE, in test_override_virtio_hot_unplug_q35()
1046 g_strdup("-device pcie-root-port,id=p0 " in test_override_virtio_hot_unplug_q35()
1047 "-device pcie-pci-bridge,bus=p0,id=b1 " in test_override_virtio_hot_unplug_q35()
1048 "-machine q35")); in test_override_virtio_hot_unplug_q35()
1055 test_override_hot_unplug(args, "virtio-disk0", expected, expected2); in test_override_virtio_hot_unplug_q35()
1078 qtest_add_func("hd-geo/ide/none", test_ide_none); in main()
1079 qtest_add_func("hd-geo/ide/drive/mbr/blank", test_ide_drive_mbr_blank); in main()
1080 qtest_add_func("hd-geo/ide/drive/mbr/lba", test_ide_drive_mbr_lba); in main()
1081 qtest_add_func("hd-geo/ide/drive/mbr/chs", test_ide_drive_mbr_chs); in main()
1082 qtest_add_func("hd-geo/ide/drive/cd_0", test_ide_drive_cd_0); in main()
1083 qtest_add_func("hd-geo/ide/device/mbr/blank", test_ide_device_mbr_blank); in main()
1084 qtest_add_func("hd-geo/ide/device/mbr/lba", test_ide_device_mbr_lba); in main()
1085 qtest_add_func("hd-geo/ide/device/mbr/chs", test_ide_device_mbr_chs); in main()
1086 qtest_add_func("hd-geo/ide/device/user/chs", test_ide_device_user_chs); in main()
1087 qtest_add_func("hd-geo/ide/device/user/chst", test_ide_device_user_chst); in main()
1091 g_test_message("QTEST_QEMU_IMG not set or qemu-img missing; " in main()
1092 "skipping hd-geo/override/* tests"); in main()
1097 qtest_add_func("hd-geo/override/ide", test_override_ide); in main()
1099 qtest_add_func("hd-geo/override/scsi", test_override_scsi); in main()
1100 if (qtest_has_device("virtio-scsi-pci")) { in main()
1101 qtest_add_func("hd-geo/override/scsi_2_controllers", in main()
1105 qtest_add_func("hd-geo/override/zero_chs", test_override_zero_chs); in main()
1106 if (qtest_has_device("virtio-scsi-pci")) { in main()
1107 qtest_add_func("hd-geo/override/scsi_hot_unplug", in main()
1110 if (qtest_has_device("virtio-blk-pci")) { in main()
1111 qtest_add_func("hd-geo/override/virtio_hot_unplug", in main()
1113 qtest_add_func("hd-geo/override/virtio_blk", in main()
1119 qtest_add_func("hd-geo/override/sata", test_override_sata); in main()
1120 qtest_add_func("hd-geo/override/zero_chs_q35", in main()
1123 qtest_add_func("hd-geo/override/scsi_q35", in main()
1126 if (qtest_has_device("virtio-scsi-pci")) { in main()
1127 qtest_add_func("hd-geo/override/scsi_hot_unplug_q35", in main()
1130 if (qtest_has_device("virtio-blk-pci")) { in main()
1131 qtest_add_func("hd-geo/override/virtio_hot_unplug_q35", in main()
1133 qtest_add_func("hd-geo/override/virtio_blk_q35", in main()