git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fish: Fix incorrect path passed to perror.
[libguestfs.git]
/
tools
/
virt-resize
diff --git
a/tools/virt-resize
b/tools/virt-resize
index
76abb1e
..
5d0673a
100755
(executable)
--- a/
tools/virt-resize
+++ b/
tools/virt-resize
@@
-1,6
+1,6
@@
#!/usr/bin/perl -w
# virt-resize
#!/usr/bin/perl -w
# virt-resize
-# Copyright (C) 2010 Red Hat Inc.
+# Copyright (C) 2010
-2011
Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@
-67,7
+67,7
@@
Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions
to fill the extra 5GB of space.
truncate -r olddisk newdisk; truncate -s +5G newdisk
to fill the extra 5GB of space.
truncate -r olddisk newdisk; truncate -s +5G newdisk
- virt-filesystems --long -
-
h --all -a olddisk
+ virt-filesystems --long -h --all -a olddisk
# Note "/dev/sda2" is a partition inside the "olddisk" file.
virt-resize --expand /dev/sda2 olddisk newdisk
# Note "/dev/sda2" is a partition inside the "olddisk" file.
virt-resize --expand /dev/sda2 olddisk newdisk
@@
-598,7
+598,8
@@
sub launch_guestfs
@args = ($outfile);
push @args, format => $output_format if defined $output_format;
$g->add_drive_opts (@args);
@args = ($outfile);
push @args, format => $output_format if defined $output_format;
$g->add_drive_opts (@args);
- $g->set_progress_callback (\&progress_callback) unless $quiet;
+ $g->set_event_callback (\&progress_callback, $Sys::Guestfs::EVENT_PROGRESS)
+ unless $quiet;
$g->launch ();
}
$g->launch ();
}
@@
-1401,10
+1402,15
@@
sub canonicalize
# I intend to use an external library for this at some point (XXX).
sub progress_callback
{
# I intend to use an external library for this at some point (XXX).
sub progress_callback
{
- my $proc_nr = shift;
- my $serial = shift;
- my $position = shift;
- my $total = shift;
+ my $event = shift;
+ my $event_handle = shift;
+ my $buf = shift;
+ my $array = shift;
+
+ my $proc_nr = $array->[0];
+ my $serial = $array->[1];
+ my $position = $array->[2];
+ my $total = $array->[3];
my $ratio = $position / $total;
if ($ratio < 0) { $ratio = 0 }
my $ratio = $position / $total;
if ($ratio < 0) { $ratio = 0 }