Files
libguestfs/lib
Nikolay Ivanets 94843f155a lib: add support for disks with 4096 bytes sector size
Nowadays there are hard drives and operating systems which support
"4K native" sector size.  In this mode physical and logical block size
exposed to the operating system is equal to 4096 bytes.

GPT partition table (as a known example) being created in this mode will
place GPT header at LBA1 which is 4096 bytes.  libguetfs is unable to
recognize partition table on such physical block devices or disk images.
The reason is that libguestfs appliance will look for a GPT header at
LBA1 which is seen at 512 byte offset.

In order to fix the issue we need a way to provide correct logical block
size for attached disks.  Fortunately QEMU and libvirt already provides
a way to specify physical/logical block size per disk basis.

After discussion in a mailing list we agreed that physical block size is
rarely used and is not so important.  Thus both physical and logical
block size will be set to the same value.

In this patch one more optional parameter 'blocksize' is added
to add_drive_opts API method.  Valid values are 512 and 4096.

add_drive_scratch has the same optional parameter for a consistency and
testing purpose.

add-domain and add_libvirt_dom will pass logical_block_size value from
libvirt XML to add_drive_opts method.
2020-02-11 15:20:09 +00:00
..
2019-01-08 11:58:30 +00:00
2019-01-08 11:58:30 +00:00
2017-01-26 15:05:46 +00:00
2019-01-08 11:58:30 +00:00
2019-01-08 11:58:30 +00:00
2017-01-26 15:05:46 +00:00
2019-01-08 11:58:30 +00:00
2019-01-08 11:58:30 +00:00
2019-04-01 18:44:00 +02:00
2017-01-26 15:05:46 +00:00
2019-01-08 11:58:30 +00:00
2019-01-08 11:58:30 +00:00
2017-01-26 15:05:46 +00:00
2017-01-26 15:05:46 +00:00
2017-01-26 15:05:46 +00:00
2019-01-08 11:58:30 +00:00
2019-11-29 12:04:55 +01:00
2019-01-08 11:58:30 +00:00
2017-01-26 15:05:46 +00:00
2017-01-26 15:05:46 +00:00
2019-01-08 11:58:30 +00:00
2017-01-26 15:05:46 +00:00
2019-01-08 11:58:30 +00:00