mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-09 21:08:46 +00:00
qm mtunnel: add write helper
reduce code duplication. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
58cbe63901
commit
79c9e07933
@ -265,11 +265,15 @@ __PACKAGE__->register_method ({
|
|||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "tunnel online\n";
|
my $tunnel_write = sub {
|
||||||
*STDOUT->flush();
|
my $text = shift;
|
||||||
|
chomp $text;
|
||||||
|
print "$text\n";
|
||||||
|
*STDOUT->flush();
|
||||||
|
};
|
||||||
|
|
||||||
print "ver 1\n";
|
$tunnel_write->("tunnel online");
|
||||||
*STDOUT->flush();
|
$tunnel_write->("ver 1");
|
||||||
|
|
||||||
while (my $line = <>) {
|
while (my $line = <>) {
|
||||||
chomp $line;
|
chomp $line;
|
||||||
|
Loading…
Reference in New Issue
Block a user