Changeset 697 in vbox
- Timestamp:
- Feb 6, 2007 9:54:46 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 18335
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/VmdkHDD.cpp
-
Property svn:eol-style
set to
native
r258 r697 25 25 * 26 26 * Block driver for the VMDK format 27 * 27 * 28 28 * Copyright (c) 2004 Fabrice Bellard 29 29 * Copyright (c) 2005 Filip Navara 30 * 30 * 31 31 * Permission is hereby granted, free of charge, to any person obtaining a copy 32 32 * of this software and associated documentation files (the "Software"), to deal … … 273 273 } else if (magic == VMDK4_MAGIC) { 274 274 VMDK4Header header; 275 275 276 276 rc = RTFileRead(s->File, &header, sizeof(header), NULL); 277 277 AssertRC(rc); … … 287 287 goto fail; 288 288 } 289 s->l1_size = (s->total_sectors + s->l1_entry_sectors - 1) 289 s->l1_size = (s->total_sectors + s->l1_entry_sectors - 1) 290 290 / s->l1_entry_sectors; 291 291 s->l1_table_offset = le64_to_cpu(header.rgd_offset) << 9; … … 364 364 uint64_t cluster_offset; 365 365 int rc; 366 366 367 367 l1_index = (offset >> 9) / s->l1_entry_sectors; 368 368 if (l1_index >= s->l1_size) … … 447 447 } 448 448 449 static int vmdk_is_allocated(BDRVVmdkState *s, int64_t sector_num, 449 static int vmdk_is_allocated(BDRVVmdkState *s, int64_t sector_num, 450 450 int nb_sectors, int *pnum) 451 451 { … … 462 462 } 463 463 464 static int vmdk_read(BDRVVmdkState *s, int64_t sector_num, 464 static int vmdk_read(BDRVVmdkState *s, int64_t sector_num, 465 465 uint8_t *buf, int nb_sectors) 466 466 { 467 467 int index_in_cluster, n; 468 468 uint64_t cluster_offset; 469 469 470 470 while (nb_sectors > 0) { 471 471 cluster_offset = get_cluster_offset(s, sector_num << 9, 0); … … 494 494 } 495 495 496 static int vmdk_write(BDRVVmdkState *s, int64_t sector_num, 496 static int vmdk_write(BDRVVmdkState *s, int64_t sector_num, 497 497 const uint8_t *buf, int nb_sectors) 498 498 { -
Property svn:eol-style
set to
Note:
See TracChangeset
for help on using the changeset viewer.