In RBDPlugin.pm i found this part and i was wondering how it works.

   my $parser = sub {
        my $line = shift;

if ($line =~ m/^((vm|base)-(\d+)-disk-\d+)\s+(\d+)(M|G|T)\s((\S+)\/((vm|base)-\d+-\S+@\S+))?/) { my ($image, $owner, $size, $unit, $parent) = ($1, $3, $4, $5, $8);

            $list->{$pool}->{$image} = {
                name => $image,
                size => $size*rbd_unittobytes()->{$unit},
                parent => $parent,
                vmid => $owner
            };
        }
    };

    eval {
run_command($cmd, errmsg => "rbd error", errfunc => sub { }, outfunc => $parser);
    };
    my $err = $@;

====>    under which circumstances does run_command die? errorcode != 0?

    die $err if $err && $err !~ m/doesn't contain rbd images/ ;

Where does this content $@ comes from? errfunc does nothing...

Thanks!

Stefan
_______________________________________________
pve-devel mailing list
[email protected]
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to