block.c (9f4bd6baf64b8139cf2d7f8f53a98b27531da13c) block.c (541dc0d47f10973c241e9955afc2aefc96adec51)
1/*
2 * QEMU System Emulator block driver
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 1313 unchanged lines hidden (view full) ---

1322 uint8_t sector; /* starting sector */
1323 uint8_t cyl; /* starting cylinder */
1324 uint8_t sys_ind; /* What partition type */
1325 uint8_t end_head; /* end head */
1326 uint8_t end_sector; /* end sector */
1327 uint8_t end_cyl; /* end cylinder */
1328 uint32_t start_sect; /* starting sector counting from 0 */
1329 uint32_t nr_sects; /* nr of sectors in partition */
1/*
2 * QEMU System Emulator block driver
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 1313 unchanged lines hidden (view full) ---

1322 uint8_t sector; /* starting sector */
1323 uint8_t cyl; /* starting cylinder */
1324 uint8_t sys_ind; /* What partition type */
1325 uint8_t end_head; /* end head */
1326 uint8_t end_sector; /* end sector */
1327 uint8_t end_cyl; /* end cylinder */
1328 uint32_t start_sect; /* starting sector counting from 0 */
1329 uint32_t nr_sects; /* nr of sectors in partition */
1330} __attribute__((packed));
1330} QEMU_PACKED;
1331
1332/* try to guess the disk logical geometry from the MSDOS partition table. Return 0 if OK, -1 if could not guess */
1333static int guess_disk_lchs(BlockDriverState *bs,
1334 int *pcylinders, int *pheads, int *psectors)
1335{
1336 uint8_t buf[BDRV_SECTOR_SIZE];
1337 int ret, i, heads, sectors, cylinders;
1338 struct partition *p;

--- 1992 unchanged lines hidden ---
1331
1332/* try to guess the disk logical geometry from the MSDOS partition table. Return 0 if OK, -1 if could not guess */
1333static int guess_disk_lchs(BlockDriverState *bs,
1334 int *pcylinders, int *pheads, int *psectors)
1335{
1336 uint8_t buf[BDRV_SECTOR_SIZE];
1337 int ret, i, heads, sectors, cylinders;
1338 struct partition *p;

--- 1992 unchanged lines hidden ---