FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora/Linux Management Tools

 
 
LinkBack Thread Tools
 
Old 12-03-2008, 01:26 AM
 
Default Fix mount/unmount for Solaris

# HG changeset patch
# User john.levon@sun.com
# Date 1228271149 28800
# Node ID a4538c6c2d6690526d80c011b46b4700c23a9ffd
# Parent 7069ca5b2ced261f19438d3091af89aea2441b88
Fix mount/unmount for Solaris

mount is not portable: fix for Solaris

Signed-off-by: John Levon <john.levon@sun.com>

diff --git a/virtinst/ImageFetcher.py b/virtinst/ImageFetcher.py
--- a/virtinst/ImageFetcher.py
+++ b/virtinst/ImageFetcher.py
@@ -180,14 +180,23 @@ class MountedImageFetcher(LocalImageFetc
def prepareLocation(self):
cmd = None
self.srcdir = tempfile.mkdtemp(prefix="virtinstmnt.", dir=self.scratchdir)
+ mountcmd = "/bin/mount"
+ if os.uname()[0] == "SunOS":
+ mountcmd = "/usr/sbin/mount"
+
logging.debug("Preparing mount at " + self.srcdir)
if self.location.startswith("nfs:"):
- cmd = ["mount", "-o", "ro", self.location[4:], self.srcdir]
+ cmd = [mountcmd, "-o", "ro", self.location[4:], self.srcdir]
else:
if stat.S_ISBLK(os.stat(self.location)[stat.ST_MODE]):
- cmd = ["mount", "-o", "ro", self.location, self.srcdir]
+ mountopt = "ro"
else:
- cmd = ["mount", "-o", "ro,loop", self.location, self.srcdir]
+ mountopt = "ro,loop"
+ if os.uname()[0] == 'SunOS':
+ cmd = [mountcmd, "-F", "hsfs", "-o",
+ mountopt, self.location, self.srcdir]
+ else:
+ cmd = [mountcmd, "-o", mountopt, self.location, self.srcdir]
ret = subprocess.call(cmd)
if ret != 0:
self.cleanupLocation()
@@ -197,7 +206,10 @@ class MountedImageFetcher(LocalImageFetc

def cleanupLocation(self):
logging.debug("Cleaning up mount at " + self.srcdir)
- cmd = ["umount", self.srcdir]
+ if os.uname()[0] == "SunOS":
+ cmd = ["/usr/sbin/umount", self.srcdir]
+ else:
+ cmd = ["/bin/umount", self.srcdir]
subprocess.call(cmd)
try:
os.rmdir(self.srcdir)

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 12-03-2008, 08:39 AM
"Daniel P. Berrange"
 
Default Fix mount/unmount for Solaris

On Tue, Dec 02, 2008 at 06:26:02PM -0800, john.levon@sun.com wrote:
> # HG changeset patch
> # User john.levon@sun.com
> # Date 1228271149 28800
> # Node ID a4538c6c2d6690526d80c011b46b4700c23a9ffd
> # Parent 7069ca5b2ced261f19438d3091af89aea2441b88
> Fix mount/unmount for Solaris
>
> mount is not portable: fix for Solaris

ACK.

Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 12-03-2008, 02:51 PM
Cole Robinson
 
Default Fix mount/unmount for Solaris

john.levon@sun.com wrote:
> # HG changeset patch
> # User john.levon@sun.com
> # Date 1228271149 28800
> # Node ID a4538c6c2d6690526d80c011b46b4700c23a9ffd
> # Parent 7069ca5b2ced261f19438d3091af89aea2441b88
> Fix mount/unmount for Solaris
>
> mount is not portable: fix for Solaris
>
> Signed-off-by: John Levon <john.levon@sun.com>
>

Applied:

http://hg.et.redhat.com/virt/applications/virtinst--devel?cs=74febd10a8a9

Thanks,
Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 

Thread Tools




All times are GMT. The time now is 08:48 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org