]> git.ipfire.org Git - thirdparty/libvirt.git/commit
disk: Use virStorageBackendZeroPartitionTable
authorJohn Ferlan <jferlan@redhat.com>
Fri, 7 Apr 2017 13:36:05 +0000 (09:36 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 26 Apr 2017 11:28:08 +0000 (07:28 -0400)
commit3c4f2e3fb725054921f855a229afc7daca7119ae
tree27ae022ea83b5363293470e655fe0abd78bae287
parentd942bf6e9e8e3991808ca5185098257e84acab5d
disk: Use virStorageBackendZeroPartitionTable

https://bugzilla.redhat.com/show_bug.cgi?id=1439132

During 'matrix' testing of all possible combinations I found that if
device is formated with "gpt" first, then an attempt is made to format
using "mac", a startup will fail.

Deeper analysis by Peter Krempa indicates that the "mac" table fits
into the first block on the disk. Since the GPT disklabel is stored
at LBA address 1 it is not overwritten at all. Thus it's apparent that
the (blkid) detection tool then prefers GPT over a older disklabel.

The GPT disklabel has also a secondary copy at the last LBA of the disk.

So, follow the same logic as the logical pool in clearing a 1MB swath
at the beginning and end of the device to avoid potential issues with
larger sector sizes for the device.

Also fixed a minor formatting nit in virStorageBackendDeviceIsEmpty call.
src/storage/storage_backend_disk.c