]>
git.proxmox.com Git - pve-guest-common.git/blob - PVE/VZDump/Plugin.pm
1 package PVE
::VZDump
::Plugin
;
6 use POSIX
qw(strftime);
18 my ($mtype, $msg, $logfd, $syslog) = @_;
24 my $level = $log_level->{$mtype} ?
$mtype : 'err';
25 my $pre = $log_level->{$level};
27 my $timestr = strftime
("%F %H:%M:%S", CORE
::localtime);
29 syslog
($level, "$pre $msg") if $syslog;
31 foreach my $line (split (/\n/, $msg)) {
32 print STDERR
"$pre $line\n";
33 print $logfd "$timestr $pre $line\n" if $logfd;
38 my ($self, $logfd) = @_;
40 $self->{logfd
} = $logfd;
44 my ($self, $cmdstr, %param) = @_;
48 debugmsg
('info', $line, $self->{logfd
});
51 PVE
::Tools
::run_command
($cmdstr, %param, logfunc
=> $logfunc);
55 my ($self, $cmdstr, %param) = @_;
58 eval { $res = $self->cmd($cmdstr, %param); };
59 $self->logerr ($@) if $@;
64 my ($self, $msg) = @_;
66 debugmsg
('info', $msg, $self->{logfd
}, 0);
70 my ($self, $msg) = @_;
72 debugmsg
('err', $msg, $self->{logfd
}, 0);
82 return [ keys %{$self->{vmlist
}} ] if $self->{vmlist
};
88 my ($self, $vmid) = @_;
90 die "internal error"; # implement in subclass
94 my ($self, $task, $vmid, $mode) = @_;
96 die "internal error"; # implement in subclass
100 my ($self, $vmid) = @_;
102 die "internal error"; # implement in subclass
106 my ($self, $vmid) = @_;
108 die "internal error"; # implement in subclass
112 my ($self, $task, $vmid) = @_;
114 die "internal error"; # implement in subclass
118 my ($self, $task, $vmid) = @_;
120 die "internal error"; # implement in subclass
124 my ($self, $task, $vmid) = @_;
126 die "internal error"; # implement in subclass
130 my ($self, $task, $vmid) = @_;
132 die "internal error"; # implement in subclass
136 my ($self, $task, $vmid) = @_;
138 die "internal error"; # implement in subclass
141 sub copy_data_phase2
{
142 my ($self, $task, $vmid) = @_;
144 die "internal error"; # implement in subclass
148 my ($self, $task, $vmid) = @_;
150 die "internal error"; # implement in subclass
154 my ($self, $task, $vmid, $filename, $comp) = @_;
156 die "internal error"; # implement in subclass
160 my ($self, $task, $vmid) = @_;
162 die "internal error"; # implement in subclass