Re: [Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure
On Tue, Sep 19, 2023 at 11:59:43AM +, Raja Ram Sharma wrote: > Hi Richard, > > Thank you for the response, will set both handler and let you know. > > when we try to execute guestfs_mount_local. > Getting below error : > > [ 2023-09-19 13:34:05 ] errno: ( 0 ) : mount_local: unknown option 554101136 > (this can happen if a program is compiled against a newer version of > libguestfs, then dynamically linked to an older version) I attach what I said previously. Rich. > Setup details : > OS : (PRETTY_NAME="Red Hat Enterprise Linux 8.2 (Ootpa)") > Guesfs.h version : 1.50 > Guestfish version : guestfish > 1.38.4rhel=8,release=15.module+el8.2.0+5297+222a20af,libvirt > > In Below scenario: > 1. guestfs_mount_local_run > 2. umount /mountpoint > 3. Again, while trying to mount, after sleep of 20sec. > > > Thanks > RR > > > > > > -Original Message- > From: Richard W.M. Jones > Sent: Tuesday, September 19, 2023 1:15 PM > To: Raja Ram Sharma > Cc: Teja Konapalli ; libguestfs@redhat.com; > Divyanshu Kumar > Subject: Re: [EXTERNAL] - Re: LIBGUESTFS mount disk failure > > CAUTION: This email originated from outside of the organization. Do not click > links or open attachments unless you recognize the sender and know the > content is safe. If you feel that the email is suspicious, please report it > using PhishAlarm. > > > On Sun, Sep 17, 2023 at 04:11:25PM +, Raja Ram Sharma wrote: > > One more help is needed : > > https://urldefense.com/v3/__https://github.com/libguestfs/libguestfs/i > > ssues/124__;!!Obbck6kTJA!blek-uFsj3xPSaSiNQrS-1lk59I6-udl4zqOJCxZ6LLeu > > pvAFl6tPfod_GU2BLm_19gJUs3OXp6_IUEM$ > > /***/ > > I can get guestfs_last_error using function_callback and write to log file. > > But "event Handling" is not working Also, std::cout and std::cerr still > > printing on terminal. > > Is there any workaround for Event Handling? > > How to completely disable/enable standard output? > > /***/ > > > > In short, Any Debugging sample program, > > https://urldefense.com/v3/__https://github.com/libguestfs/libguestfs/i > > ssues/124__;!!Obbck6kTJA!blek-uFsj3xPSaSiNQrS-1lk59I6-udl4zqOJCxZ6LLeu > > pvAFl6tPfod_GU2BLm_19gJUs3OXp6_IUEM$ > > In the two programs in that issue, the first program sets an event callback > and the second program sets an error handler. To capture all messages you > must set both together. > > If you can produce a single, short reproducer which uses both types of > handlers and still prints to stderr, then I can look at that. > > Rich. > > -- > Richard Jones, Virtualization Group, Red Hat > https://urldefense.com/v3/__http://people.redhat.com/*rjones__;fg!!Obbck6kTJA!blek-uFsj3xPSaSiNQrS-1lk59I6-udl4zqOJCxZ6LLeupvAFl6tPfod_GU2BLm_19gJUs3OXuHRnZTv$ > Read my programming and virtualization blog: > https://urldefense.com/v3/__http://rwmj.wordpress.com__;!!Obbck6kTJA!blek-uFsj3xPSaSiNQrS-1lk59I6-udl4zqOJCxZ6LLeupvAFl6tPfod_GU2BLm_19gJUs3OXrVS1VaN$ > Fedora Windows cross-compiler. Compile Windows programs, test, and build > Windows installers. Over 100 libraries supported. > https://urldefense.com/v3/__http://fedoraproject.org/wiki/MinGW__;!!Obbck6kTJA!blek-uFsj3xPSaSiNQrS-1lk59I6-udl4zqOJCxZ6LLeupvAFl6tPfod_GU2BLm_19gJUs3OXjCvHvVp$ -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW --- Begin Message --- On Sun, Sep 17, 2023 at 03:55:24AM +, Raja Ram Sharma wrote: > Hi Richard, > > Wish you a happy weekend! > > Guestfs_launch fails after below error : > > libguestfs: is_openable: /dev/kvm: No such file or directory > libguestfs: trace: get_backend_setting "force_tcg" > libguestfs: trace: get_backend_setting = NULL (error) > ^^^ > Same line has also printed in " LIBGUESTFS_BACKEND=direct > libguestfs-test-tool " at line $96-$98 > ^^^ > Could not access KVM kernel module: No such file or directory > qemu-kvm: failed to initialize KVM: No such file or directory > ^^^ Thanks for providing the second output. The above messages aren't errors. I really need much more context. I need to see the program that you're trying to run, or a self-contained reproducer, and I also need to see the _complete_ output from the program from start to finish, not just small parts of it. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com nbdkit - Flexible, fast NBD server with plugins https://gitlab.com/nbdkit/nbdkit --- End Message --- ___ Libguestfs mailing list Libguestfs@redhat.com
Re: [Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure
Hi Richard, Thank you for the response, will set both handler and let you know. when we try to execute guestfs_mount_local. Getting below error : [ 2023-09-19 13:34:05 ] errno: ( 0 ) : mount_local: unknown option 554101136 (this can happen if a program is compiled against a newer version of libguestfs, then dynamically linked to an older version) Setup details : OS : (PRETTY_NAME="Red Hat Enterprise Linux 8.2 (Ootpa)") Guesfs.h version : 1.50 Guestfish version : guestfish 1.38.4rhel=8,release=15.module+el8.2.0+5297+222a20af,libvirt In Below scenario: 1. guestfs_mount_local_run 2. umount /mountpoint 3. Again, while trying to mount, after sleep of 20sec. Thanks RR -Original Message- From: Richard W.M. Jones Sent: Tuesday, September 19, 2023 1:15 PM To: Raja Ram Sharma Cc: Teja Konapalli ; libguestfs@redhat.com; Divyanshu Kumar Subject: Re: [EXTERNAL] - Re: LIBGUESTFS mount disk failure CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. If you feel that the email is suspicious, please report it using PhishAlarm. On Sun, Sep 17, 2023 at 04:11:25PM +, Raja Ram Sharma wrote: > One more help is needed : > https://urldefense.com/v3/__https://github.com/libguestfs/libguestfs/i > ssues/124__;!!Obbck6kTJA!blek-uFsj3xPSaSiNQrS-1lk59I6-udl4zqOJCxZ6LLeu > pvAFl6tPfod_GU2BLm_19gJUs3OXp6_IUEM$ > /***/ > I can get guestfs_last_error using function_callback and write to log file. > But "event Handling" is not working Also, std::cout and std::cerr still > printing on terminal. > Is there any workaround for Event Handling? > How to completely disable/enable standard output? > /***/ > > In short, Any Debugging sample program, > https://urldefense.com/v3/__https://github.com/libguestfs/libguestfs/i > ssues/124__;!!Obbck6kTJA!blek-uFsj3xPSaSiNQrS-1lk59I6-udl4zqOJCxZ6LLeu > pvAFl6tPfod_GU2BLm_19gJUs3OXp6_IUEM$ In the two programs in that issue, the first program sets an event callback and the second program sets an error handler. To capture all messages you must set both together. If you can produce a single, short reproducer which uses both types of handlers and still prints to stderr, then I can look at that. Rich. -- Richard Jones, Virtualization Group, Red Hat https://urldefense.com/v3/__http://people.redhat.com/*rjones__;fg!!Obbck6kTJA!blek-uFsj3xPSaSiNQrS-1lk59I6-udl4zqOJCxZ6LLeupvAFl6tPfod_GU2BLm_19gJUs3OXuHRnZTv$ Read my programming and virtualization blog: https://urldefense.com/v3/__http://rwmj.wordpress.com__;!!Obbck6kTJA!blek-uFsj3xPSaSiNQrS-1lk59I6-udl4zqOJCxZ6LLeupvAFl6tPfod_GU2BLm_19gJUs3OXrVS1VaN$ Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. https://urldefense.com/v3/__http://fedoraproject.org/wiki/MinGW__;!!Obbck6kTJA!blek-uFsj3xPSaSiNQrS-1lk59I6-udl4zqOJCxZ6LLeupvAFl6tPfod_GU2BLm_19gJUs3OXjCvHvVp$ ___ Libguestfs mailing list Libguestfs@redhat.com https://listman.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] [External] Re: [PATCH] VxFS Filesystem support to libguestfs
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
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
Re: [Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure
On Sun, Sep 17, 2023 at 04:11:25PM +, Raja Ram Sharma wrote: > One more help is needed : https://github.com/libguestfs/libguestfs/issues/124 > /***/ > I can get guestfs_last_error using function_callback and write to log file. > But "event Handling" is not working Also, std::cout and std::cerr still > printing on terminal. > Is there any workaround for Event Handling? > How to completely disable/enable standard output? > /***/ > > In short, Any Debugging sample program, > https://github.com/libguestfs/libguestfs/issues/124 In the two programs in that issue, the first program sets an event callback and the second program sets an error handler. To capture all messages you must set both together. If you can produce a single, short reproducer which uses both types of handlers and still prints to stderr, then I can look at that. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW ___ Libguestfs mailing list Libguestfs@redhat.com https://listman.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] [libnbd PATCH] generator: Fix assertion with ill-formed 64-bit block status reply
On Mon, Sep 18, 2023 at 02:31:28PM -0500, Eric Blake wrote: > If a server replies to a block status command with an invalid length > in NBD_REPLY_TYPE_BLOCK_STATUS_EXT, we correctly detect the server's > error, but fail to mark that we've consumed enough data off the wire > to resync back to the server's next reply. Symptoms seen during a > fuzzing run: > > │ $ ./fuzzing/libnbd-fuzz-wrapper > │+id\:01\,sig\:06\,src\:000396\,time\:16888628\,execs\:54159419\,op\:havoc\,rep\:4 > │ libnbd-fuzz-wrapper: generator/states-reply-chunk.c:698: > enter_STATE_REPLY_CHUNK_REPLY_FINISH: > │+Assertion `h->payload_left == 0' failed. > │ Aborted (core dumped) > │ read: Connection reset by peer > > Appears to be a casualty of rebasing: I added h->payload_left > verification fairly late in the game, then floated it earlier in the > series, and missed a spot where I added a state machine jump to RESYNC > without having updated h->payload_left. An audit of all other > assignments to h->rlen in that file was able to find corresponding > assignments to h->payload_left (often the next statement, but > sometimes split across states based on what made the next state easier > to code). > > Requires a non-compliant server, but I was able to come up with a > one-line tweak to pending qemu patches that could trigger it. Not > creating a CVE as it only appears in unstable releases. > > Fixes: ab992766cd ("block_status: Accept 64-bit extents during block status") > Thanks: Richard W.M. Jones > Signed-off-by: Eric Blake > --- > > I'm investigating another crash that Rich sent me off-list, but I > suspect it will be a similar non-CVE situation caused by my recent > 64-bit extension patches. > > I'll wait to apply this one for just a bit more, in case I can get the > corpus file or two from Rich's fuzzing run to add to > fuzzing/testcase_dir. > > generator/states-reply-chunk.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/generator/states-reply-chunk.c b/generator/states-reply-chunk.c > index 2cebe456..a5d3aefe 100644 > --- a/generator/states-reply-chunk.c > +++ b/generator/states-reply-chunk.c > @@ -476,6 +476,7 @@ REPLY.CHUNK_REPLY.RECV_BS_HEADER: >if (h->bs_count != be32toh (h->sbuf.reply.payload.bs_hdr_64.count)) { > h->rbuf = NULL; > h->rlen = h->payload_left; > +h->payload_left = 0; > SET_NEXT_STATE (%RESYNC); > return 0; >} ACK, thanks. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com nbdkit - Flexible, fast NBD server with plugins https://gitlab.com/nbdkit/nbdkit ___ Libguestfs mailing list Libguestfs@redhat.com https://listman.redhat.com/mailman/listinfo/libguestfs
Re: [Libguestfs] [EXTERNAL] - Re: LIBGUESTFS supported version
Hi Richard, Could you please help here with the update? Regards, Teja Konapalli -Original Message- From: Teja Konapalli Sent: Tuesday, September 12, 2023 1:25 PM To: Richard W.M. Jones Cc: libguestfs@redhat.com Subject: RE: [EXTERNAL] - Re: [Libguestfs] LIBGUESTFS supported version Hi Richard, There's no information here. What program are you using? --> we are using sample c++ program What exact version of the program and libguestfs? -->version 1.38.0 What operating system are you using? -->RHEL 8.2 How did you obtain and install libguestfs? Installed through this command sudo yum install libguestfs-tools . Regards, Teja K -Original Message- From: Richard W.M. Jones Sent: Tuesday, September 12, 2023 1:14 PM To: Teja Konapalli Cc: libguestfs@redhat.com Subject: Re: [EXTERNAL] - Re: [Libguestfs] LIBGUESTFS supported version CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. If you feel that the email is suspicious, please report it using PhishAlarm. On Tue, Sep 12, 2023 at 06:44:54AM +, Teja Konapalli wrote: > Hi Richard & Team, > > Am getting below issue frequently when I try to mount using libguestfs. > > [ 2023-09-12 08:17:43 ] errno: ( 0 ) : mount_local: unknown option > 1804310928 (this can happen if a program is compiled against a newer > version of libguestfs, then dynamically linked to an older version) [ > 2023-09-12 08:17:45 ] errno: ( 0 ) : mount_local: unknown option > 1804310928 (this can happen if a program is compiled against a newer > version of libguestfs, then dynamically linked to an older version) [ > 2023-09-12 08:17:47 ] errno: ( 0 ) : mount_local: unknown option > 1804310928 (this can happen if a program is compiled against a newer > version of libguestfs, then dynamically linked to an older version) There's no information here. What program are you using? What exact version of the program and libguestfs? What operating system are you using? How did you obtain and install libguestfs? etc. Rich. -- Richard Jones, Virtualization Group, Red Hat https://urldefense.com/v3/__http://people.redhat.com/*rjones__;fg!!Obbck6kTJA!YruXPeOhVGJTOULQGG0dNevCF1Ltq_Nd2Xkegc0y3D_mKq0C475vj-qMH9c_4xHbKhFvICspUcSQPHr5kQ$ Read my programming and virtualization blog: https://urldefense.com/v3/__http://rwmj.wordpress.com__;!!Obbck6kTJA!YruXPeOhVGJTOULQGG0dNevCF1Ltq_Nd2Xkegc0y3D_mKq0C475vj-qMH9c_4xHbKhFvICspUcR-Y2VZqA$ libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. https://urldefense.com/v3/__http://libguestfs.org__;!!Obbck6kTJA!YruXPeOhVGJTOULQGG0dNevCF1Ltq_Nd2Xkegc0y3D_mKq0C475vj-qMH9c_4xHbKhFvICspUcQFlpFVjg$ ___ Libguestfs mailing list Libguestfs@redhat.com https://listman.redhat.com/mailman/listinfo/libguestfs