Re: [Libguestfs] [External] Re: [PATCH] VxFS Filesystem support to libguestfs

2023-09-21 Thread Ravi Singh
Hi Richard,

Thank you for making these changes. We appreciate your insights. We will 
promptly address the issues you have mentioned, thoroughly test them.

We will keep you updated and send you the patch once we have completed the 
testing.

Thanks,
Ravi/Gaurang

From: Richard W.M. Jones 
Sent: Tuesday, September 19, 2023 4:30 PM
To: Ravi Singh 
Cc: libguestfs@redhat.com ; Aswad Kulkarni 
; Shailesh Marathe ; 
Sumit Dighe ; Mitul Kothari 
; Brad Boyer ; Saket 
Pusalkar ; Gaurang Agnihotri 
; Satyajit Gorhe parlikar 
; John Cronin 
Subject: Re: [External] Re: [Libguestfs] [PATCH] VxFS Filesystem support to 
libguestfs


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe. If you believe this is a phishing email, use the Report to 
Cybersecurity icon in Outlook.



A new patch is attached.  This is only build tested so far.

To build with this patch I had to do:

  ./configure --enable-werror \
  --with-supermin-packager-config=$PWD/localyum.conf

where localyum.conf contains:

--
[local]
name=local
baseurl=file:///root/dvd1-redhatlinux/rhel9_x86_64/rpms/
enabled=1
gpgcheck=0
--

(adjust the path to point to the Veritas DVD mount point)


I made various changes in this patch:

- Add copyright and license notice to list_vxvm.ml & vxfs.c.  Please
  ensure all files have copyright and license notices, and if necessary
  get them checked by your legal.

- Change vm.ml{,i} -> list_vxvm.ml{,i}

- In packagelist.in, move package names to their own section.

- Remove perl/python packages as perl/python is not present in
  the appliance.

- Fix commit message.

- Line length under 80 columns in a few places.

- Function names at start of line.

- List SOURCES_MLI alphabetically.

- daemon/listfs.ml: Remove comment about has_vxvm.

- do_vxfs_start -> vxfs_start (since do_* is reserved prefix in daemon).

- Skip vxfs_start if !vxdisk available, to save start up time.

- Add a prototype for vxfs_start.

- Don't use reply_with_error in vxfs_start, as we're not called
  during protocol context.

- Use only one *err.

- Add daemon/list_vxvm.mli & daemon/vxvm_type.mli to .gitignore


vxfs_start has several issues which need to be addressed:

 - Why does it return if a service (eg. veki) is not available?  That
   would prevent all further initialization.

 - I think this would be better done as part of appliance/init, and
   delete this function completely.



Rich.

--
Richard Jones, Virtualization Group, Red Hat 
https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpeople.redhat.com%2F~rjones=05%7C01%7Cravi.singh%40veritas.com%7C6df598eb4c58442388ef08dbb8ffa410%7Cfc8e13c0422c4c55b3eaca318e6cac32%7C0%7C0%7C638307180357901926%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=oNbYsYG%2B0kJX%2FSUyTgba10nH8762rEvcEWqN1n4tlHs%3D=0<http://people.redhat.com/~rjones>
Read my programming and virtualization blog: 
https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Frwmj.wordpress.com%2F=05%7C01%7Cravi.singh%40veritas.com%7C6df598eb4c58442388ef08dbb8ffa410%7Cfc8e13c0422c4c55b3eaca318e6cac32%7C0%7C0%7C638307180357901926%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=LP%2BLKvr3i%2Bc%2BTbIln8uIdakIrWhbYyOW8reELLnIvqE%3D=0<http://rwmj.wordpress.com/>
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  
https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibguestfs.org%2F=05%7C01%7Cravi.singh%40veritas.com%7C6df598eb4c58442388ef08dbb8ffa410%7Cfc8e13c0422c4c55b3eaca318e6cac32%7C0%7C0%7C638307180357901926%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=IFYqpYgPgyXOcW%2BLHkKww9nIwPm4oiOiyjrnw3IpT5o%3D=0<http://libguestfs.org/>
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs


Re: [Libguestfs] [External] Re: [PATCH] VxFS Filesystem support to libguestfs

2023-09-19 Thread Richard W.M. Jones
A new patch is attached.  This is only build tested so far.

To build with this patch I had to do:

  ./configure --enable-werror \
  --with-supermin-packager-config=$PWD/localyum.conf 

where localyum.conf contains:

--
[local]
name=local
baseurl=file:///root/dvd1-redhatlinux/rhel9_x86_64/rpms/
enabled=1
gpgcheck=0
--

(adjust the path to point to the Veritas DVD mount point)


I made various changes in this patch:

- Add copyright and license notice to list_vxvm.ml & vxfs.c.  Please
  ensure all files have copyright and license notices, and if necessary
  get them checked by your legal.

- Change vm.ml{,i} -> list_vxvm.ml{,i}

- In packagelist.in, move package names to their own section.

- Remove perl/python packages as perl/python is not present in
  the appliance.

- Fix commit message.

- Line length under 80 columns in a few places.

- Function names at start of line.

- List SOURCES_MLI alphabetically.

- daemon/listfs.ml: Remove comment about has_vxvm.

- do_vxfs_start -> vxfs_start (since do_* is reserved prefix in daemon).

- Skip vxfs_start if !vxdisk available, to save start up time.

- Add a prototype for vxfs_start.

- Don't use reply_with_error in vxfs_start, as we're not called
  during protocol context.

- Use only one *err.

- Add daemon/list_vxvm.mli & daemon/vxvm_type.mli to .gitignore


vxfs_start has several issues which need to be addressed:

 - Why does it return if a service (eg. veki) is not available?  That
   would prevent all further initialization.

 - I think this would be better done as part of appliance/init, and
   delete this function completely.



Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org
>From 997cd736acf59432804aebb469fc1c6dbe56a9fd Mon Sep 17 00:00:00 2001
From: "ravi.singh" 
Date: Fri, 15 Sep 2023 15:40:50 +0530
Subject: [PATCH] Add VxFS Filesystem support

---
 .gitignore|   2 +
 appliance/init|   2 +
 appliance/packagelist.in  |   8 +++
 daemon/Makefile.am|   9 ++-
 daemon/daemon.h   |   3 +
 daemon/guestfsd.c |   3 +
 daemon/list_vxvm.ml   |  78 
 daemon/listfs.ml  |  13 
 daemon/vxfs.c | 122 ++
 daemon/vxvm_type.ml   |  17 ++
 generator/actions_core.ml |  24 
 generator/proc_nr.ml  |   2 +
 lib/MAX_PROC_NR   |   2 +-
 po/POTFILES   |   1 +
 14 files changed, 284 insertions(+), 2 deletions(-)
 create mode 100644 daemon/list_vxvm.ml
 create mode 100644 daemon/vxfs.c
 create mode 100644 daemon/vxvm_type.ml

diff --git a/.gitignore b/.gitignore
index ee5ea74dd..28d327ea0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -96,6 +96,7 @@ Makefile.in
 /daemon/ldm.mli
 /daemon/link.mli
 /daemon/listfs.mli
+/daemon/list_vxvm.mli
 /daemon/lvm.mli
 /daemon/lvm_dm.mli
 /daemon/lvm-tokenization.c
@@ -118,6 +119,7 @@ Makefile.in
 /daemon/stubs-?.c
 /daemon/stubs.h
 /daemon/types.ml
+/daemon/vxvm_type.mli
 /depcomp
 /docs/guestfs-building.1
 /docs/guestfs-faq.1
diff --git a/appliance/init b/appliance/init
index d41056659..535a3d6b1 100755
--- a/appliance/init
+++ b/appliance/init
@@ -22,6 +22,8 @@ mount -t proc /proc /proc
 mount -t sysfs /sys /sys
 # devtmpfs is required since udev 176
 mount -t devtmpfs /dev /dev
+# Create dev directory for all VxVM device files.
+mkdir -p /dev/vx
 ln -s /proc/self/fd /dev/fd
 
 # Parse the kernel command line early (must be after /proc is mounted).
diff --git a/appliance/packagelist.in b/appliance/packagelist.in
index 20b08c470..06d4aaf6d 100644
--- a/appliance/packagelist.in
+++ b/appliance/packagelist.in
@@ -271,5 +271,13 @@ exfat-utils
 exfatprogs
 fuse-exfat
 
+dnl Proprietary Veritas packages for VxFS support
+dnl VRTSperl
+dnl VRTSpython
+VRTSveki
+VRTSvlic
+VRTSvxfs
+VRTSvxvm
+
 dnl Define this by doing: ./configure --with-extra-packages="..."
 EXTRA_PACKAGES
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index bd1920c61..b251bebf4 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -51,6 +51,8 @@ generator_built = \
link.mli \
listfs.mli \
lvm.mli \
+   list_vxvm.mli \
+   vxvm_type.mli \
lvm_dm.mli \
md.mli \
mount.mli \
@@ -208,6 +210,7 @@ guestfsd_SOURCES = \
wc.c \
xattr.c \
xfs.c \
+   vxfs.c \
yara.c \
zero.c \
zerofree.c
@@ -292,6 +295,7 @@ SOURCES_MLI = \
isoinfo.mli \
ldm.mli \
link.mli \
+   list_vxvm.mli \
listfs.mli \
lvm.mli \
lvm_dm.mli \
@@ -307,7 +311,8 @@ SOURCES_MLI = \
statvfs.mli \

Re: [Libguestfs] [External] Re: [PATCH] VxFS Filesystem support to libguestfs

2023-09-19 Thread Richard W.M. Jones
On Fri, Sep 15, 2023 at 11:37:32AM +, Ravi Singh wrote:
> >>> Fixed. Added VRTS* packages to packagelist.in and removed the
> above scripts from hostfiles.

OK, that should work.  I will test it out later.

One issue we'll probably have is how to package this up for Fedora or
RHEL as those require that the RPMs are available at build time (which
is not possible as they are not open source).

It may be that you will need to build a "libguestfs-vxfs" package
yourself, built against your RPMs.  It's fairly simple to do this but
let's cross that bridge later.

> >>> The approach here we took to pass the package name as an extra parameter
> during libguestfs initial configure stage to eliminate our package
> dependencies. But as you suggested added to packagelist.in.
> 
> e.g:
> ./configure --with-extra-packages="VRTSperl VRTSpython VRTSveki VRTSvlic
> VRTSvxfs VRTSvxvm"

I see.  That would work, but including the package names in
appliance/packagelist.in makes everything easier.

> > +  /* Start vxfs services */
> > +  do_vxfs_start();
> > +
> 
> >>> Fixed. That was not intentional. Simple function works fine.

Good.

> >> Please find the attached zip file, contains latest patch and commands to
> create VxVM volumes and VxFS for testing this patch.

Alright, I'll try this out soon.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs