[libvirt] [PATCH v2 5/3] disk: Force usage of parted when checking disk format for "bsd"

John Ferlan posted 3 patches 8 years, 10 months ago
[libvirt] [PATCH v2 5/3] disk: Force usage of parted when checking disk format for "bsd"
Posted by John Ferlan 8 years, 10 months ago
https://bugzilla.redhat.com/show_bug.cgi?id=1439132

Add "bsd" to the list of format types to not checked during blkid
processing even though it supposedly knows the format - for some
(now unknown) reason it's returning partiion not found. So let's
just let PARTED handle "bsd" too.

Signed-off-by: John Ferlan <jferlan@redhat.com>
---

 Difference to v1: Just pull out and send separately.

 src/storage/storage_util.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 4ced81e..812429e 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -3034,10 +3034,12 @@ virStorageBackendBLKIDFindPart(blkid_probe probe,
 
     /* A blkid_known_pttype on "dvh" and "pc98" returns a failure;
      * however, the blkid_do_probe for "dvh" returns "sgi" and
-     * for "pc98" it returns "dos". So since those will cause problems
+     * for "pc98" it returns "dos". Although "bsd" is recognized,
+     * it seems that the parted created partition table is not being
+     * properly recogized. Since each of these will cause problems
      * with startup comparison, let's just treat them as UNKNOWN causing
      * the caller to fallback to using PARTED */
-    if (STREQ(format, "dvh") || STREQ(format, "pc98"))
+    if (STREQ(format, "dvh") || STREQ(format, "pc98") || STREQ(format, "bsd"))
         return VIR_STORAGE_BLKID_PROBE_UNKNOWN;
 
     /* Make sure we're doing a partitions probe from the start */
-- 
2.9.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 5/3] disk: Force usage of parted when checking disk format for "bsd"
Posted by Peter Krempa 8 years, 10 months ago
On Fri, Apr 07, 2017 at 09:53:40 -0400, John Ferlan wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1439132
> 
> Add "bsd" to the list of format types to not checked during blkid
> processing even though it supposedly knows the format - for some
> (now unknown) reason it's returning partiion not found. So let's

s/partiion/partition/

Also it's not really a partition, it's a disklabel or partition table.

> just let PARTED handle "bsd" too.
> 
> Signed-off-by: John Ferlan <jferlan@redhat.com>
> ---
> 
>  Difference to v1: Just pull out and send separately.
> 
>  src/storage/storage_util.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
> index 4ced81e..812429e 100644
> --- a/src/storage/storage_util.c
> +++ b/src/storage/storage_util.c
> @@ -3034,10 +3034,12 @@ virStorageBackendBLKIDFindPart(blkid_probe probe,
>  
>      /* A blkid_known_pttype on "dvh" and "pc98" returns a failure;
>       * however, the blkid_do_probe for "dvh" returns "sgi" and
> -     * for "pc98" it returns "dos". So since those will cause problems
> +     * for "pc98" it returns "dos". Although "bsd" is recognized,
> +     * it seems that the parted created partition table is not being
> +     * properly recogized. Since each of these will cause problems
>       * with startup comparison, let's just treat them as UNKNOWN causing
>       * the caller to fallback to using PARTED */
> -    if (STREQ(format, "dvh") || STREQ(format, "pc98"))
> +    if (STREQ(format, "dvh") || STREQ(format, "pc98") || STREQ(format, "bsd"))
>          return VIR_STORAGE_BLKID_PROBE_UNKNOWN;
>  
>      /* Make sure we're doing a partitions probe from the start */

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