Re: [Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure

2023-09-21 Thread Divyanshu Kumar
Hi @Richard W.M. Jones,

I am attaching a sample program of how we are using guestfs apis where we are 
getting this error guestfs_mount_local fail.

Please take a look into this.

Thanks,
Divyanshu

-Original Message-
From: Richard W.M. Jones  
Sent: Tuesday, September 19, 2023 5:36 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 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-udl4zqOJCxZ6LL
> > eu 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-udl4zqOJCxZ6LL
> > eu 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!!Obb
> ck6kTJA!blek-uFsj3xPSaSiNQrS-1lk59I6-udl4zqOJCxZ6LLeupvAFl6tPfod_GU2BL
> m_19gJUs3OXuHRnZTv$ Read my programming and virtualization blog: 
> https://urldefense.com/v3/__http://rwmj.wordpress.com__;!!Obbck6kTJA!b
> lek-uFsj3xPSaSiNQrS-1lk59I6-udl4zqOJCxZ6LLeupvAFl6tPfod_GU2BLm_19gJUs3
> OXrVS1VaN$ 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__;!!Ob
> bck6kTJA!blek-uFsj3xPSaSiNQrS-1lk59I6-udl4zqOJCxZ6LLeupvAFl6tPfod_GU2B
> Lm_19gJUs3OXjCvHvVp$

--
Richard Jones, Virtualization Group, Red Hat 
https://urldefense.com/v3/__http://people.redhat.com/*rjones__;fg!!Obbck6kTJA!ZE9Jts1w7JGiKHKAcLv1I72RncLG2NUVxKSn4yXEUiITBywqaqIgR4po1KK5rdHojo9l36xX1V-CKYfN$
Read my programming and virtualization blog: 
https://urldefense.com/v3/__http://rwmj.wordpress.com__;!!Obbck6kTJA!ZE9Jts1w7JGiKHKAcLv1I72RncLG2NUVxKSn4yXEUiITBywqaqIgR4po1KK5rdHojo9l36xX1WGJ1lVR$
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!ZE9Jts1w7JGiKHKAcLv1I72RncLG2NUVxKSn4yXEUiITBywqaqIgR4po1KK5rdHojo9l36xX1XNZvfww$
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#define FILESYSTEM "filesystem"
using namespace std;

std::fstream log_file;

void message_callback (guestfs_h *g, void 

Re: [Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure

2023-09-20 Thread Richard W.M. Jones
On Wed, Sep 20, 2023 at 09:53:19AM +, Divyanshu Kumar wrote:
> Hi @Richard W.M. Jones,
>
> I am attaching a sample program of how we are using guestfs apis
> where we are getting this error guestfs_mount_local fail.

It works fine, I see no errors when I run it.

This is the third and last time I'll repeat this.  If you ignore it
again then I won't reply to any more emails from you.  So I advise you
to read it very carefully:

  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
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs



Re: [Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure

2023-09-19 Thread Richard W.M. Jones
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

2023-09-19 Thread Raja Ram Sharma
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: LIBGUESTFS mount disk failure

2023-09-19 Thread Richard W.M. Jones
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] [EXTERNAL] - Re: LIBGUESTFS mount disk failure

2023-09-17 Thread Raja Ram Sharma
Thank you, Richard!

Guestfs_launch was failing due to internal program issue. Since guesfs_launch 
creates new process for guesfs process.

Hence, Guestfs_launch was failing since new process creation failed in internal 
program due to remote connection.


We resolved using Deamon and Sender logic. 
When Deamon will receive message from sender to launch guest it will launch 
guestfs runner program => Happy Path is working.

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 

Libguestfs:issue$124, contains sample program.


Thanks
RR

-Original Message-
From: Richard W.M. Jones  
Sent: Sunday, September 17, 2023 2:12 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 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 
https://urldefense.com/v3/__http://people.redhat.com/*rjones__;fg!!Obbck6kTJA!cGvW3aE83Ft-GmRGWxqYLh85g0kvttA_BT6dWlewP_XXEySJTE_7VerRYsyHmY3gHfNZEoSwXyazG9cD$
Read my programming and virtualization blog: 
https://urldefense.com/v3/__http://rwmj.wordpress.com__;!!Obbck6kTJA!cGvW3aE83Ft-GmRGWxqYLh85g0kvttA_BT6dWlewP_XXEySJTE_7VerRYsyHmY3gHfNZEoSwX1BFUle1$
nbdkit - Flexible, fast NBD server with plugins 
https://urldefense.com/v3/__https://gitlab.com/nbdkit/nbdkit__;!!Obbck6kTJA!cGvW3aE83Ft-GmRGWxqYLh85g0kvttA_BT6dWlewP_XXEySJTE_7VerRYsyHmY3gHfNZEoSwXx0dimlz$

___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs



Re: [Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure

2023-09-17 Thread Raja Ram Sharma
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
^^^

Please find attachment of $> LIBGUESTFS_BACKEND=direct libguestfs-test-tool

Thanks 
RR


-Original Message-
From: Richard W.M. Jones  
Sent: Sunday, September 17, 2023 2:07 AM
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.


Thanks for providing the libguestfs-test-tool output in a previous message.

> While: guestfs_lanch error:
>   libguestfs: trace: set_verbose true
>   libguestfs: trace: set_verbose = 0
>   libguestfs: trace: set_backend "direct"
>   libguestfs: trace: set_backend = 0

Here you're setting backend = "direct", and while that isn't necessarily a 
problem in itself, the libguestfs-test-tool output that you provided was for 
the (normal, for RHEL) libvirt backend.

This could make a difference, so what's the output of:

  $ LIBGUESTFS_BACKEND=direct libguestfs-test-tool

?

By the way, unless you have a specific reason to set 
'LIBGUESTFS_BACKEND=direct' that you can articulate, it is best not to set this 
as it is less secure and less well tested.  If you just copied that environment 
variable from somewhere without understanding why, then don't do that.

Rich.

--
Richard Jones, Virtualization Group, Red Hat 
https://urldefense.com/v3/__http://people.redhat.com/*rjones__;fg!!Obbck6kTJA!dH7uryqvh0lZ5fENv-UGELBhZf_4YeDluWD8HOiX9HhMDMbDUVpoUkP-GHdUVq06f9twxzOInZAGIZOv$
Read my programming and virtualization blog: 
https://urldefense.com/v3/__http://rwmj.wordpress.com__;!!Obbck6kTJA!dH7uryqvh0lZ5fENv-UGELBhZf_4YeDluWD8HOiX9HhMDMbDUVpoUkP-GHdUVq06f9twxzOInU_4VCMe$
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!dH7uryqvh0lZ5fENv-UGELBhZf_4YeDluWD8HOiX9HhMDMbDUVpoUkP-GHdUVq06f9twxzOInTq6QXk4$

[root@iwf1118164 ~]# LIBGUESTFS_BACKEND=direct libguestfs-test-tool
 
 *IMPORTANT NOTICE
 *
 * When reporting bugs, include the COMPLETE, UNEDITED
 * output below in your bug report.
 *
 
LIBGUESTFS_BACKEND=direct
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
XDG_RUNTIME_DIR=/run/user/0
SELinux: Enforcing
guestfs_get_append: (null)
guestfs_get_autosync: 1
guestfs_get_backend: direct
guestfs_get_backend_settings: []
guestfs_get_cachedir: /var/tmp
guestfs_get_hv: /usr/libexec/qemu-kvm
guestfs_get_memsize: 500
guestfs_get_network: 0
guestfs_get_path: /usr/lib64/guestfs
guestfs_get_pgroup: 0
guestfs_get_program: libguestfs-test-tool
guestfs_get_recovery_proc: 1
guestfs_get_smp: 1
guestfs_get_sockdir: /tmp
guestfs_get_tmpdir: /tmp
guestfs_get_trace: 0
guestfs_get_verbose: 1
host_cpu: x86_64
Launching appliance, timeout set to 600 seconds.
libguestfs: launch: program=libguestfs-test-tool
libguestfs: launch: 
version=1.38.4rhel=8,release=15.module+el8.2.0+5297+222a20af,libvirt
libguestfs: launch: backend registered: unix
libguestfs: launch: backend registered: uml
libguestfs: launch: backend registered: libvirt
libguestfs: launch: backend registered: direct
libguestfs: launch: backend=direct
libguestfs: launch: tmpdir=/tmp/libguestfs3rE6U0
libguestfs: launch: umask=0022
libguestfs: launch: euid=0
libguestfs: is_openable: /dev/kvm: No such file or directory
libguestfs: begin building supermin appliance
libguestfs: run supermin
libguestfs: command: run: /usr/bin/supermin
libguestfs: command: run: \ --build
libguestfs: command: run: \ --verbose
libguestfs: command: run: \ --if-newer
libguestfs: command: run: \ --lock /var/tmp/.guestfs-0/lock
libguestfs: command: run: \ --copy-kernel
libguestfs: command: run: \ -f ext2
libguestfs: command: run: \ --host-cpu x86_64
libguestfs: command: run: \ /usr/lib64/guestfs/supermin.d
libguestfs: command: run: \ -o /var/tmp/.guestfs-0/appliance.d
supermin: version: 5.1.19
supermin: rpm: detected RPM version 4.14
supermin: package handler: fedora/rpm
supermin: acquiring lock on /var/tmp/.guestfs-0/lock
supermin: if-newer: output does 

Re: [Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure

2023-09-17 Thread Raja Ram Sharma
Hi Richard, 

Please find attachment.

Thanks
RR

-Original Message-
From: Richard W.M. Jones  
Sent: Sunday, September 17, 2023 12:01 AM
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.


Hi, can you run:

  libguestfs-test-tool

and send us the complete output.

Rich.

--
Richard Jones, Virtualization Group, Red Hat 
https://urldefense.com/v3/__http://people.redhat.com/*rjones__;fg!!Obbck6kTJA!cUhKTzkHbeycH9ONmg7YVuA28RxRwLfJ3XfePXETLBjNcS3vefsLwC2HoDNyIltFDhvduQ5NSIeGrD_b$
Read my programming and virtualization blog: 
https://urldefense.com/v3/__http://rwmj.wordpress.com__;!!Obbck6kTJA!cUhKTzkHbeycH9ONmg7YVuA28RxRwLfJ3XfePXETLBjNcS3vefsLwC2HoDNyIltFDhvduQ5NSFHTYeM4$
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!cUhKTzkHbeycH9ONmg7YVuA28RxRwLfJ3XfePXETLBjNcS3vefsLwC2HoDNyIltFDhvduQ5NSJEawKzk$

[root@iwf1118164 ~]#   libguestfs-test-tool
 
 *IMPORTANT NOTICE
 *
 * When reporting bugs, include the COMPLETE, UNEDITED
 * output below in your bug report.
 *
 
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
XDG_RUNTIME_DIR=/run/user/0
SELinux: Enforcing
guestfs_get_append: (null)
guestfs_get_autosync: 1
guestfs_get_backend: libvirt
guestfs_get_backend_settings: []
guestfs_get_cachedir: /var/tmp
guestfs_get_hv: /usr/libexec/qemu-kvm
guestfs_get_memsize: 500
guestfs_get_network: 0
guestfs_get_path: /usr/lib64/guestfs
guestfs_get_pgroup: 0
guestfs_get_program: libguestfs-test-tool
guestfs_get_recovery_proc: 1
guestfs_get_smp: 1
guestfs_get_sockdir: /tmp
guestfs_get_tmpdir: /tmp
guestfs_get_trace: 0
guestfs_get_verbose: 1
host_cpu: x86_64
Launching appliance, timeout set to 600 seconds.
libguestfs: launch: program=libguestfs-test-tool
libguestfs: launch: 
version=1.38.4rhel=8,release=15.module+el8.2.0+5297+222a20af,libvirt
libguestfs: launch: backend registered: unix
libguestfs: launch: backend registered: uml
libguestfs: launch: backend registered: libvirt
libguestfs: launch: backend registered: direct
libguestfs: launch: backend=libvirt
libguestfs: launch: tmpdir=/tmp/libguestfsMogiUb
libguestfs: launch: umask=0022
libguestfs: launch: euid=0
libguestfs: libvirt version = 4005000 (4.5.0)
libguestfs: guest random name = guestfs-8ld1b37qkd0lijw1
libguestfs: connect to libvirt
libguestfs: opening libvirt handle: URI = qemu:///system, auth = 
default+wrapper, flags = 0
libguestfs: successfully opened libvirt handle: conn = 0x5565989aa530
libguestfs: qemu version (reported by libvirt) = 2012000 (2.12.0)
libguestfs: get libvirt capabilities
libguestfs: parsing capabilities XML
libguestfs: build appliance
libguestfs: begin building supermin appliance
libguestfs: run supermin
libguestfs: command: run: /usr/bin/supermin
libguestfs: command: run: \ --build
libguestfs: command: run: \ --verbose
libguestfs: command: run: \ --if-newer
libguestfs: command: run: \ --lock /var/tmp/.guestfs-0/lock
libguestfs: command: run: \ --copy-kernel
libguestfs: command: run: \ -f ext2
libguestfs: command: run: \ --host-cpu x86_64
libguestfs: command: run: \ /usr/lib64/guestfs/supermin.d
libguestfs: command: run: \ -o /var/tmp/.guestfs-0/appliance.d
supermin: version: 5.1.19
supermin: rpm: detected RPM version 4.14
supermin: package handler: fedora/rpm
supermin: acquiring lock on /var/tmp/.guestfs-0/lock
supermin: if-newer: output does not need rebuilding
libguestfs: finished building supermin appliance
libguestfs: command: run: qemu-img
libguestfs: command: run: \ create
libguestfs: command: run: \ -f qcow2
libguestfs: command: run: \ -o 
backing_file=/var/tmp/.guestfs-0/appliance.d/root,backing_fmt=raw
libguestfs: command: run: \ /tmp/libguestfsMogiUb/overlay2.qcow2
Formatting '/tmp/libguestfsMogiUb/overlay2.qcow2', fmt=qcow2 size=4294967296 
backing_file=/var/tmp/.guestfs-0/appliance.d/root backing_fmt=raw 
cluster_size=65536 lazy_refcounts=off refcount_bits=16
libguestfs: create libvirt XML
libguestfs: command: run: dmesg | grep -Eoh 'lpj=[[:digit:]]+'
libguestfs: read_lpj_from_dmesg: calculated lpj=2397223
libguestfs: libvirt XML:\n\nhttp://libvirt.org/schemas/domain/qemu/1.0;>\n  
guestfs-8ld1b37qkd0lijw1\n  500\n  
500\n  1\n  \n\n\n\n  
\n  \nhvm\n
/var/tmp/.guestfs-0/appliance.d/kernel\n
/var/tmp/.guestfs-0/appliance.d/initrd\npanic=1 
console=ttyS0 edd=off udevtimeout=6000 udev.event-timeout=6000 no_timer_check 
lpj=2397223 

Re: [Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure

2023-09-17 Thread Raja Ram Sharma
Hi Richard, 

Thank you for the reply, I hope this mail finds you well.

We resolved guestfs_add_drive failure, now guestfs_add_drive is adding disk 
successfully after adding "format:raw".

But guestfs_launch is failing Kindly help me to troubleshoot or to find any 
workaround. 

Error_callback is in-place, it return guestfs_last_error()

guestfs_last_error():
[ 2023-09-16 17:24:20 ]  errno: ( 10 ) : command: waitpid: No child 
processes
[ 2023-09-16 17:24:20 ]  errno: ( 10 ) : command: waitpid: No child 
processes

While: guestfs_lanch error:
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
libguestfs: trace: set_backend "direct"
libguestfs: trace: set_backend = 0
libguestfs: create: flags = 0, handle = 0xbb0a70, program = greagent.exe
libguestfs: trace: add_drive 
"/var/opt/omni/tmp/GRE/5029f5c4-e08d-23e1-07d3-96c5c7ffeeac/2023/09/16-3/5029f5c4-e08d-23e1-07d3-96c5c7ffeeac/Datastore2-9166/RAJATEST/RAJATEST_1-flat.vmdk"
 "format:raw"
libguestfs: trace: add_drive = 0
libguestfs: trace: add_drive 
"/var/opt/omni/tmp/GRE/5029f5c4-e08d-23e1-07d3-96c5c7ffeeac/2023/09/16-3/5029f5c4-e08d-23e1-07d3-96c5c7ffeeac/Datastore2-9166/RAJATEST/RAJATEST_2-flat.vmdk"
 "format:raw"
libguestfs: trace: add_drive = 0
libguestfs: trace: add_drive 
"/var/opt/omni/tmp/GRE/5029f5c4-e08d-23e1-07d3-96c5c7ffeeac/2023/09/16-3/5029f5c4-e08d-23e1-07d3-96c5c7ffeeac/Datastore2-9166/RAJATEST/RAJATEST-flat.vmdk"
 "format:raw"
libguestfs: trace: add_drive = 0
libguestfs: trace: launch
libguestfs: trace: max_disks
libguestfs: trace: max_disks = 255
libguestfs: trace: get_tmpdir
libguestfs: trace: get_tmpdir = "/tmp"
libguestfs: trace: version
libguestfs: trace: version = 
libguestfs: trace: get_backend
libguestfs: trace: get_backend = "direct"
libguestfs: launch: program=greagent.exe
libguestfs: launch: 
version=1.38.4rhel=8,release=15.module+el8.2.0+5297+222a20af,libvirt
libguestfs: launch: backend registered: unix
libguestfs: launch: backend registered: uml
libguestfs: launch: backend registered: libvirt
libguestfs: launch: backend registered: direct
libguestfs: launch: backend=direct
libguestfs: launch: tmpdir=/tmp/libguestfsMzD9Rl
libguestfs: launch: umask=0002
libguestfs: launch: euid=0
libguestfs: is_openable: /dev/kvm: No such file or directory
libguestfs: trace: get_backend_setting "force_tcg"
libguestfs: trace: get_backend_setting = NULL (error)
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
libguestfs: begin building supermin appliance
libguestfs: run supermin
libguestfs: command: run: /usr/bin/supermin
libguestfs: command: run: \ --build
libguestfs: command: run: \ --verbose
libguestfs: command: run: \ --if-newer
libguestfs: command: run: \ --lock /var/tmp/.guestfs-0/lock
libguestfs: command: run: \ --copy-kernel
libguestfs: command: run: \ -f ext2
libguestfs: command: run: \ --host-cpu x86_64
libguestfs: command: run: \ /usr/lib64/guestfs/supermin.d
libguestfs: command: run: \ -o /var/tmp/.guestfs-0/appliance.d
supermin: version: 5.1.19
supermin: rpm: detected RPM version 4.14
supermin: package handler: fedora/rpm
supermin: acquiring lock on /var/tmp/.guestfs-0/lock
supermin: if-newer: output does not need rebuilding
libguestfs: trace: launch = -1 (error)
libguestfs: trace: close
libguestfs: closing guestfs handle 0xbb0a70 (state 0)
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /tmp/libguestfsMzD9Rl


Thanks
RR




-Original Message-
From: Richard W.M. Jones  
Sent: Saturday, September 16, 2023 9:39 PM
To: Teja Konapalli 
Cc: libguestfs@redhat.com; Raja Ram Sharma ; Divyanshu 
Kumar 
Subject: [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 Sat, Sep 16, 2023 at 03:56:07PM +, Teja Konapalli wrote:
> Hi Richard & Team,
>
>
>
> Could you please help here on the below failure of mounting disk using 
> libguestfs.
>
>
>
> OS version: RHEL 8.2
>
> Libguestfs version: 1.38.0 stable
>
>
>
>
>
> Error logs:
>
>
>
> libguestfs: trace: add_drive_ro "/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk"
> libguestfs: trace: add_drive "/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk"
> "readonly:true"
> libguestfs: creating COW overlay to protect original drive content
> libguestfs: trace: disk_create "/tmp/libguestfsCpl8My/overlay3.qcow2" "qcow2"
> -1 

Re: [Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure

2023-09-17 Thread Richard W.M. Jones
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
___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs



Re: [Libguestfs] [EXTERNAL] - Re: LIBGUESTFS mount disk failure

2023-09-16 Thread Richard W.M. Jones
Thanks for providing the libguestfs-test-tool output in a previous
message.

> While: guestfs_lanch error:
>   libguestfs: trace: set_verbose true
>   libguestfs: trace: set_verbose = 0
>   libguestfs: trace: set_backend "direct"
>   libguestfs: trace: set_backend = 0

Here you're setting backend = "direct", and while that isn't
necessarily a problem in itself, the libguestfs-test-tool output that
you provided was for the (normal, for RHEL) libvirt backend.

This could make a difference, so what's the output of:

  $ LIBGUESTFS_BACKEND=direct libguestfs-test-tool

?

By the way, unless you have a specific reason to set
'LIBGUESTFS_BACKEND=direct' that you can articulate, it is best not to
set this as it is less secure and less well tested.  If you just
copied that environment variable from somewhere without understanding
why, then don't do 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] [EXTERNAL] - Re: LIBGUESTFS mount disk failure

2023-09-16 Thread Richard W.M. Jones
Hi, can you run:

  libguestfs-test-tool

and send us the complete output.

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] [EXTERNAL] - Re: LIBGUESTFS mount disk failure

2023-09-16 Thread Teja Konapalli
@Raja Ram Sharma
 Can you please help here with the details requested by Rich.

To answer this question Is this happening in a program you wrote?  Yes, we had 
written our code to use libguestfs API in c++. 

We can have a short call and discuss with you or team, could you please help 
with the timings next week Monday or Tuesday.

Thanks
Teja Konapalli


-Original Message-
From: Richard W.M. Jones  
Sent: Saturday, September 16, 2023 9:39 PM
To: Teja Konapalli 
Cc: libguestfs@redhat.com; Raja Ram Sharma ; Divyanshu 
Kumar 
Subject: [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 Sat, Sep 16, 2023 at 03:56:07PM +, Teja Konapalli wrote:
> Hi Richard & Team,
>
>
>
> Could you please help here on the below failure of mounting disk using 
> libguestfs.
>
>
>
> OS version: RHEL 8.2
>
> Libguestfs version: 1.38.0 stable
>
>
>
>
>
> Error logs:
>
>
>
> libguestfs: trace: add_drive_ro "/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk"
> libguestfs: trace: add_drive "/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk"
> "readonly:true"
> libguestfs: creating COW overlay to protect original drive content
> libguestfs: trace: disk_create "/tmp/libguestfsCpl8My/overlay3.qcow2" "qcow2"
> -1 "backingfile:/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk"
> libguestfs: command: run: qemu-img
> libguestfs: command: run: \ create
> libguestfs: command: run: \ -f qcow2
> libguestfs: command: run: \ -o backing_file=/var/opt/tmp/GRE//RAJA/
> RAJAT-flat.vmdk
> libguestfs: command: run: \ /tmp/libguestfsCpl8My/overlay3.qcow2
> Formatting '/tmp/libguestfsCpl8My/overlay3.qcow2', fmt=qcow2 
> size=21474836480 backing_file=/var/opt/tmp/GRE//RAJA/RAJAT-flat.vmdk 
> cluster_size=65536 lazy_refcounts=off refcount_bits=16
> libguestfs: trace: disk_create = -1 (error)

^^ There should be an error message between this two lines.  Without seeing 
what the error is, it's hard to know what the problem is.

Is this happening in a program you wrote?  If so you probably want to read the 
bit about how to handle error messages:

https://urldefense.com/v3/__https://libguestfs.org/guestfs.3.html*error-handling__;Iw!!Obbck6kTJA!a2FcI3CQ6qa1neQWz3uUdjBa4wFqY7ucZ6acLCMnK_P1JEntcQxfaY-P2KOkpYWBt4wXOD0RBiF0T-D7hw$

Rich.

> libguestfs: trace: add_drive = -1 (error)
> libguestfs: trace: add_drive_ro = -1 (error)
> libguestfs: trace: close
> libguestfs: closing guestfs handle 0x1e89340 (state 0)
> libguestfs: command: run: rm
> libguestfs: command: run: \ -rf /tmp/libguestfsCpl8My
>

--
Richard Jones, Virtualization Group, Red Hat 
https://urldefense.com/v3/__http://people.redhat.com/*rjones__;fg!!Obbck6kTJA!a2FcI3CQ6qa1neQWz3uUdjBa4wFqY7ucZ6acLCMnK_P1JEntcQxfaY-P2KOkpYWBt4wXOD0RBiH8yx7oyA$
Read my programming and virtualization blog: 
https://urldefense.com/v3/__http://rwmj.wordpress.com__;!!Obbck6kTJA!a2FcI3CQ6qa1neQWz3uUdjBa4wFqY7ucZ6acLCMnK_P1JEntcQxfaY-P2KOkpYWBt4wXOD0RBiEeYKbusQ$
virt-builder quickly builds VMs from scratch 
https://urldefense.com/v3/__http://libguestfs.org/virt-builder.1.html__;!!Obbck6kTJA!a2FcI3CQ6qa1neQWz3uUdjBa4wFqY7ucZ6acLCMnK_P1JEntcQxfaY-P2KOkpYWBt4wXOD0RBiGXgRfjPQ$

___
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs