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

Re: [Libguestfs] [PATCH v4 1/7] uuid: add support to change uuid of btrfs partition




> -----Original Message-----
> From: libguestfs-bounces redhat com [mailto:libguestfs-bounces redhat com] On
> Behalf Of Pino Toscano
> Sent: Tuesday, June 30, 2015 8:37 PM
> To: libguestfs redhat com
> Subject: Re: [Libguestfs] [PATCH v4 1/7] uuid: add support to change uuid of btrfs
> partition
> 
> In data martedì 30 giugno 2015 19:23:08, Chen Hanxiao ha scritto:
> > btrfs-progs v4.1 add support to change uuid of btrfs fs.
> >
> > Signed-off-by: Chen Hanxiao <chenhanxiao cn fujitsu com>
> > ---
> > [...]
> 
> > +# Setting btrfs UUID
> > +eval {
> > +    $g->set_uuid ("/dev/sda1", "12345678-1234-1234-1234-123456789012");
> > +};
> > +
> > +my $err = $g->last_errno ();
> > +
> > +if ($@) {
> 
> $@ contains the last Perl error, so it's better to check for it right
> after the eval block, otherwise other functions might change it.
> Also, $err can be moved in the if block.
> 
> > +    if ($err == Errno::ENOTSUP()) {
> > +        warn "$0: skipping test for btrfs UUID change feature is not available";
> > +    } elsif ($err) {
> 
> "else" is enough here, as $err will surely be different than zero here
> (otherwise we wouldn't be in this block).
> 

Thanks, next version will come soon.

Regards,
- Chen


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