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

Chen, Hanxiao chenhanxiao at cn.fujitsu.com
Wed Jul 1 08:51:12 UTC 2015



> -----Original Message-----
> From: libguestfs-bounces at redhat.com [mailto:libguestfs-bounces at redhat.com] On
> Behalf Of Pino Toscano
> Sent: Tuesday, June 30, 2015 8:37 PM
> To: libguestfs at 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 at 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




More information about the Libguestfs mailing list