Matthew Booth
2009-Dec-16 15:04 UTC
[Libguestfs] [PATCH] HVTarget: trivial NFC code cleanup
--- lib/Sys/VirtV2V/HVTarget/Linux.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/Sys/VirtV2V/HVTarget/Linux.pm b/lib/Sys/VirtV2V/HVTarget/Linux.pm index 53784ea..dc546de 100644 --- a/lib/Sys/VirtV2V/HVTarget/Linux.pm +++ b/lib/Sys/VirtV2V/HVTarget/Linux.pm @@ -349,7 +349,7 @@ sub _configure_kernel } # If we didn't install a new kernel, pick the default kernel - $boot_kernel = $guestos->get_default_kernel() if(!defined($boot_kernel)); + $boot_kernel ||= $guestos->get_default_kernel(); return $boot_kernel; } -- 1.6.5.2
Richard W.M. Jones
2009-Dec-16 15:07 UTC
[Libguestfs] [PATCH] HVTarget: trivial NFC code cleanup
On Wed, Dec 16, 2009 at 03:04:09PM +0000, Matthew Booth wrote:> --- > lib/Sys/VirtV2V/HVTarget/Linux.pm | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/lib/Sys/VirtV2V/HVTarget/Linux.pm b/lib/Sys/VirtV2V/HVTarget/Linux.pm > index 53784ea..dc546de 100644 > --- a/lib/Sys/VirtV2V/HVTarget/Linux.pm > +++ b/lib/Sys/VirtV2V/HVTarget/Linux.pm > @@ -349,7 +349,7 @@ sub _configure_kernel > } > > # If we didn't install a new kernel, pick the default kernel > - $boot_kernel = $guestos->get_default_kernel() if(!defined($boot_kernel)); > + $boot_kernel ||= $guestos->get_default_kernel(); > > return $boot_kernel; > } > -- > 1.6.5.2Yes, should be the same in Perl. Unless $boot_kernel could ever be the literal string "0" ... ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
Possibly Parallel Threads
- Refactor virt-v2v to be more like a 'big script'
- RHN support and capabilities
- [PATCH 1/2] ESX: Look harder for potential transfer failures
- [PATCH] internationalisation: Replace autopoint infrastructure with libintl-perl
- [PATCH] Don't remove foreign kernels during conversion