Re: [TCK PATCHv3] block devices: allow specification of size for safety

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jim Meyering wrote:
> However, I find it more readable to group the two $device-setting
> statements together:
>
>        my $device = $self->config("host_block_devices/[$devindex]/path", undef);
>        $device ||= $self->config("host_block_devices/[$devindex]", undef);

Taking Dan's correction into account, you might want to write it like this:

    my $device = ($self->config("host_block_devices/[$devindex]/path", undef)
                  || $self->config("host_block_devices/[$devindex]", undef)
                  || return undef);

or perhaps, more technically correct, in case the config value is "0":

    my $device = ($self->config("host_block_devices/[$devindex]/path", undef)
                  || $self->config("host_block_devices/[$devindex]", undef));
    defined $device
        or return undef;

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

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]