Richard W.M. Jones
2012-Oct-19 08:56 UTC
[Libguestfs] [PATCH] windows: Fix creation of /Temp/V2V directory (RHBZ#868073).
From: "Richard W.M. Jones" <rjones at redhat.com>
case_sensitive_path was not defined when called on a path where the
final element doesn't exist. In libguestfs >= 1.16.29 it was changed
to return non-NULL if the final element doesn't exist so that creation
of new files works.
---
lib/Sys/VirtConvert/Converter/Windows.pm | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/lib/Sys/VirtConvert/Converter/Windows.pm
b/lib/Sys/VirtConvert/Converter/Windows.pm
index ce89a67..d4885be 100644
--- a/lib/Sys/VirtConvert/Converter/Windows.pm
+++ b/lib/Sys/VirtConvert/Converter/Windows.pm
@@ -470,12 +470,8 @@ sub _upload_files
foreach my $d ('Temp', 'V2V') {
$path .= '/'.$d;
- eval { $path = $g->case_sensitive_path($path) };
-
- # case_sensitive_path will fail if the path doesn't exist
- if ($@) {
- $g->mkdir($path);
- }
+ $path = $g->case_sensitive_path($path);
+ $g->mkdir_p($path);
}
foreach my $file (@fb_files) {
--
1.7.11.4
Richard W.M. Jones
2012-Oct-19 09:04 UTC
[Libguestfs] [PATCH] windows: Fix creation of /Temp/V2V directory (RHBZ#868073).
I didn't actually test that patch, but I did test the attached program. It should print: Does /Temp/V2V exist? no Does /Temp/V2V exist? yes Does /Temp/V2V exist? yes Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw -------------- next part -------------- A non-text attachment was scrubbed... Name: test.pl Type: application/x-perl Size: 765 bytes Desc: not available URL: <http://listman.redhat.com/archives/libguestfs/attachments/20121019/65219496/attachment.pl>
Maybe Matching Threads
- [PATCH] Fix a Windows conversion error when C:\Temp exists in the guest
- [PATCH] Windows: Display an error containing all missing when any are missing
- [PATCH] Install VirtIO storage and network drivers in Windows
- [PATCH 1/7] Push $desc creation into Sys::VirtConvert::Converter->convert
- [PATCH v2] inspection: Fix calls to case_sensitive_path (RHBZ#858126).