[libvirt] [PATCH] conf: Allow disks with identical WWN or serial

Disallowing them broke a use case of testing multipath configurations for storage. The original intent was added as it made it impossible to use certain /dev/disk-by... links. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1349895 --- src/conf/domain_conf.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9443281..68e89ed 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -24906,20 +24906,6 @@ virDomainDiskDefCheckDuplicateInfo(const virDomainDiskDef *a, return -1; } - if (a->wwn && b->wwn && STREQ(a->wwn, b->wwn)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Disks '%s' and '%s' have identical WWN"), - a->dst, b->dst); - return -1; - } - - if (a->serial && b->serial && STREQ(a->serial, b->serial)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Disks '%s' and '%s' have identical serial"), - a->dst, b->dst); - return -1; - } - return 0; } -- 2.9.0

On Fri, Jun 24, 2016 at 05:07:43PM +0200, Peter Krempa wrote:
Disallowing them broke a use case of testing multipath configurations for storage. The original intent was added as it made it impossible to use certain /dev/disk-by... links.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1349895 --- src/conf/domain_conf.c | 14 -------------- 1 file changed, 14 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9443281..68e89ed 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -24906,20 +24906,6 @@ virDomainDiskDefCheckDuplicateInfo(const virDomainDiskDef *a, return -1; }
- if (a->wwn && b->wwn && STREQ(a->wwn, b->wwn)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Disks '%s' and '%s' have identical WWN"), - a->dst, b->dst); - return -1; - } - - if (a->serial && b->serial && STREQ(a->serial, b->serial)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Disks '%s' and '%s' have identical serial"), - a->dst, b->dst); - return -1; - } - return 0; }
ACK Though perhaps its worth a comment in that function about why we don't check serial/wwn for future readers. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Fri, Jun 24, 2016 at 16:12:58 +0100, Daniel Berrange wrote:
On Fri, Jun 24, 2016 at 05:07:43PM +0200, Peter Krempa wrote:
Disallowing them broke a use case of testing multipath configurations for storage. The original intent was added as it made it impossible to use certain /dev/disk-by... links.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1349895 --- src/conf/domain_conf.c | 14 -------------- 1 file changed, 14 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9443281..68e89ed 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c
[...]
ACK
Though perhaps its worth a comment in that function about why we don't check serial/wwn for future readers.
How about: /* Duplicate WWN/serial isn't usually problematic for the OS and * forbiding it would possibly inhibit using multipath configurations */

On Fri, Jun 24, 2016 at 05:18:25PM +0200, Peter Krempa wrote:
On Fri, Jun 24, 2016 at 16:12:58 +0100, Daniel Berrange wrote:
On Fri, Jun 24, 2016 at 05:07:43PM +0200, Peter Krempa wrote:
Disallowing them broke a use case of testing multipath configurations for storage. The original intent was added as it made it impossible to use certain /dev/disk-by... links.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1349895 --- src/conf/domain_conf.c | 14 -------------- 1 file changed, 14 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9443281..68e89ed 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c
[...]
ACK
Though perhaps its worth a comment in that function about why we don't check serial/wwn for future readers.
How about:
/* Duplicate WWN/serial isn't usually problematic for the OS and * forbiding it would possibly inhibit using multipath configurations */
Sure. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Daniel P. Berrange
-
Peter Krempa