[libvirt] [PATCH v3 4/5] logical: Increase the size of the data to wipe

John Ferlan posted 5 patches 8 years, 10 months ago
[libvirt] [PATCH v3 4/5] logical: Increase the size of the data to wipe
Posted by John Ferlan 8 years, 10 months ago
Since a sector size may be larger than 512 bytes, let's just increase
the size to wipe to 1MB rather than 2048KB

Signed-off-by: John Ferlan <jferlan@redhat.com>
---
 src/storage/storage_backend_logical.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index a865036..ed26c24 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -100,7 +100,7 @@ virStorageBackendLogicalInitializeDevice(const char *path)
      * a whole disk as a PV. So we just blank them out regardless
      * rather than trying to figure out if we're a disk or partition
      */
-    if (virStorageBackendZeroPartitionTable(path, 4 * PV_BLANK_SECTOR_SIZE) < 0)
+    if (virStorageBackendZeroPartitionTable(path, 1024 * 1024) < 0)
         return -1;
 
     /*
-- 
2.9.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v3 4/5] logical: Increase the size of the data to wipe
Posted by Michal Privoznik 8 years, 9 months ago
On 04/07/2017 06:30 PM, John Ferlan wrote:
> Since a sector size may be larger than 512 bytes, let's just increase
> the size to wipe to 1MB rather than 2048KB

2048KB = 2MB ;-)

So probably you meant 2KB?

>
> Signed-off-by: John Ferlan <jferlan@redhat.com>
> ---
>  src/storage/storage_backend_logical.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
> index a865036..ed26c24 100644
> --- a/src/storage/storage_backend_logical.c
> +++ b/src/storage/storage_backend_logical.c
> @@ -100,7 +100,7 @@ virStorageBackendLogicalInitializeDevice(const char *path)
>       * a whole disk as a PV. So we just blank them out regardless
>       * rather than trying to figure out if we're a disk or partition
>       */
> -    if (virStorageBackendZeroPartitionTable(path, 4 * PV_BLANK_SECTOR_SIZE) < 0)
> +    if (virStorageBackendZeroPartitionTable(path, 1024 * 1024) < 0)
>          return -1;
>
>      /*
>

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list