Re: [libvirt] domain.rng updated ?

2011-02-10 Thread arnaud.champion
?Ooopps,

my fault, seems I have missreaded the nrg sorry, address are well defined in 
the rng :S

Sorry,

Arnaud


From: arnaud.champ...@devatom.fr 
Sent: Thursday, February 10, 2011 5:59 PM
To: libvir-list@redhat.com 
Subject: [libvirt] domain.rng updated ?


Hi,

I'm working on C# bindings, my goal is to expose xml descriptions (domain, 
node, storage and so on...) as real C# objects, for this, I'm studying the rng 
files provided in /docs/schemas/ directory of the sources. I'm currently 
working on domain.rng.
I don't know if the domain.rng file is up to date because, for example, the 
disk device definition in the rng doesn't speak about the "address" node that a 
virhs dumpxml show :


  
  
  
  


Is the domain.rng up to date or should I use the libvirt.org XML format page 
only ?

Regards,

Arnaud





--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] domain.rng updated ?

2011-02-10 Thread arnaud.champion
?Hi,

I'm working on C# bindings, my goal is to expose xml descriptions (domain, 
node, storage and so on...) as real C# objects, for this, I'm studying the rng 
files provided in /docs/schemas/ directory of the sources. I'm currently 
working on domain.rng.
I don't know if the domain.rng file is up to date because, for example, the 
disk device definition in the rng doesn't speak about the "address" node that a 
virhs dumpxml show :


  
  
  
  


Is the domain.rng up to date or should I use the libvirt.org XML format page 
only ?

Regards,

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] Strange nodedev-dumpxml ??

2011-02-09 Thread arnaud.champion
?Hi,

I have maybe a strange thing on a nodedev-dumpxml virsh result :

virsh # nodedev-dumpxml block_sr0

  block_sr0
  scsi_0_0_1_0
  
/dev/sr0
scsi
cdrom
DVD RW DRU-190S
SONY

  0
  0

  


I think (note I'm not sure), the capabilty type removable should be in the 
device element, like this :

virsh # nodedev-dumpxml block_sr0

  block_sr0
  scsi_0_0_1_0
  
/dev/sr0
scsi
cdrom
DVD RW DRU-190S
SONY
  
  
  0
  0
  



Let me know if I'm wrong.--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] Strange nodedev-dumpxml ??

2011-02-02 Thread arnaud.champion
?Hi,

I have maybe a strange thing on a nodedev-dumpxml virsh result :

virsh # nodedev-dumpxml block_sr0

  block_sr0
  scsi_0_0_1_0
  
/dev/sr0
scsi
cdrom
DVD RW DRU-190S
SONY

  0
  0

  


I think (note I'm not sure), the capabilty type removable should be in the 
device element, like this :

virsh # nodedev-dumpxml block_sr0

  block_sr0
  scsi_0_0_1_0
  
/dev/sr0
scsi
cdrom
DVD RW DRU-190S
SONY
  
  
  0
  0
  



Let me know if I'm wrong.

Regards,

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] Node devices capability xml

2011-02-02 Thread arnaud.champion
?Hi,

I'm looking for informations about node devices capibility xml (not driver 
capabilities), and there's nothing on libvirt.org, can anyone can point me to 
find the infos ?

regards,

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] nodedev-list and qemu

2011-02-02 Thread arnaud.champion

Oki, good news ;)
Thanks

Arnaud

--
From: "Daniel P. Berrange" 
Sent: Wednesday, February 02, 2011 1:11 PM
To: 
Cc: 
Subject: Re: [libvirt] nodedev-list and qemu

On Wed, Feb 02, 2011 at 11:45:11AM +0100, arnaud.champ...@devatom.fr 
wrote:

?Hi,

I've just installed libvirt 0.8.7 on my fedora x86_64 14
test host. It seems that the function virNodeNumOfDevices
is no more supported by the qemu driver. Is that true ?
or I'm wrong anywhere ?


Sounds like you were missing the udev-devel RPM when you built
libvirt

Daniel
--
|: http://berrange.com  -o-http://www.flickr.com/photos/dberrange/ 
:|
|: http://libvirt.org  -o- http://virt-manager.org 
:|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ 
:|
|: http://entangle-photo.org   -o-   http://live.gnome.org/gtk-vnc 
:|




--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] nodedev-list and qemu

2011-02-02 Thread arnaud.champion
?Hi,

I've just installed libvirt 0.8.7 on my fedora x86_64 14 test host. It seems 
that the function virNodeNumOfDevices is no more supported by the qemu driver. 
Is that true ? or I'm wrong anywhere ?

Regards,

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] NIC model in domain description

2011-02-01 Thread arnaud.champion
?Hi,

in domain xml description, for the NIC interfaces, there is a model that 
specify the model of NIC exposed to the domain. I've understand that the model 
is driver dependent. Is there a way to know what is the driver default model ?

Regards,

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Connecting with a remote libvirt

2011-02-01 Thread arnaud.champion
?Hi,

donc forget to start libvirtd with the "-l" (listen) argument. Generally, it's 
in your /etc/init.d/libvirtd script.

Regards,

Arnaud


From: Marcela Castro León 
Sent: Tuesday, February 01, 2011 11:14 AM
To: libvir-list@redhat.com 
Subject: [libvirt] Connecting with a remote libvirt


Hello 

i'm trying to connect with a remote libvirt.

The option I selected was tcp because it's a development environment and a 
secure and isolated network,

I've configured 
listen_tcp = 1
tcp_port = "16509"

in libvirtd.conf at the destition.


I've tried to connect to host "santacruz" from a remote host "aoniken" and 
locally but pn both cases I've got:

REMOTE
marcela@aoniken:~$ virsh -c qemu+tcp://santacruz:16509 list
error: unable to connect to libvirtd at 'santacruz': Connection refused
error: failed to connect to the hypervisor

LOCALLY
radic@santacruz:/etc/libvirt$ virsh -c qemu+tcp://santacruz:16509 list
error: unable to connect to libvirtd at 'santacruz': Connection refused
error: failed to connect to the hypervisor


I've try to use ssh but i've got an error two on both cases.


REMOTE (SSH)
marcela@aoniken:~$ virsh -c qemu+ssh://radic@santacruz list
radic@santacruz's password: 
error: internal error no QEMU URI path given, try qemu:///system
error: failed to connect to the hypervisor
marcela@aoniken:~$ 

radic@santacruz:/etc/libvirt$ virsh -c qemu+ssh://radic@santacruz list
radic@santacruz's password: 
error: internal error no QEMU URI path given, try qemu:///system
error: failed to connect to the hypervisor


Can you help me?
Thank you







--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] interface description

2011-01-31 Thread arnaud.champion
?Hi,

I have an interface xml description the "model" is missing, is that normal ? if 
it is normal, what is the exposed model ?



 

   
   
   
   


Regards

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] callback question

2011-01-31 Thread arnaud.champion

Okay, I understand.

When the AddHandle function, I receive a fd (FileDescription), its value is 
3... always... Is that normal ? Is that file descriptor on a socket or on a 
file ? (In windows, when can use the WSAPoll function but it works on ly on 
sockets)


Regards,

Arnaud

--
From: "Daniel P. Berrange" 
Sent: Monday, January 31, 2011 12:43 PM
To: 
Cc: 
Subject: Re: [libvirt] callback question

On Mon, Jan 31, 2011 at 12:16:24PM +0100, arnaud.champ...@devatom.fr 
wrote:

?Hi,

Something I need to understant about callbacks:

if I install 2 callback via DomainEventRegisterAny (lifecycle
for the first and graphics for the second for example), am I
right if I said that the AddHandleFunc should be called 2 times ?


No, there is no direct relationship between the number of
calls to DomainEventRegister* and AddHandleFunc. In the
current impl we only call AddHandleFunc once per virConnect
object, but again that isn't guarenteed - different libvirt
drivers will invoke AddHandleFunc / AddTimeoutFunc a different
number of times, as is most suitable for their precise needs.

Daniel



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] callback question

2011-01-31 Thread arnaud.champion
?Hi,

Something I need to understant about callbacks:

if I install 2 callback via DomainEventRegisterAny (lifecycle for the first and 
graphics for the second for example), am I right if I said that the 
AddHandleFunc should be called 2 times ?

Regards,

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Raising events for testing

2011-01-30 Thread arnaud.champion

Hi,

One thing I need to understand, in the callback python or c samples, the 
fileDescriptor is on a socket or on a pipe ?


Regards,

Arnaud

--
From: 
Sent: Saturday, January 29, 2011 2:03 PM
To: "Daniel P. Berrange" 
Cc: 
Subject: Re: [libvirt] Raising events for testing

Okay I have understand the use and mean of poll (pollfd... 
bla...bla...bla...)
I have also discover that there is no Win32 equivalent which work with a 
file descriptor (unix way...). Win32 has a select method that can be used 
to emulate the poll function, but the fd_set structure is base on socket 
and not on a file descriptor. Does anyone know a way to have a select or 
poll function that works with file descriptor under windows ? (maybe via 
mingw, I don't know)


Regards,

Arnaud

--
From: 
Sent: Friday, January 28, 2011 7:06 PM
To: "Daniel P. Berrange" 
Cc: 
Subject: Re: [libvirt] Raising events for testing

Okay, I'm trying to understand the Python implentation (I'm not a python 
expert but it seems to be quite readable once you've understand why there 
is "self" everywhere :) ).
The thing I'm not able to understand is the call to the "poll" function 
as this function doesn't exists in C# in any library at my knows... I'm 
not fluent with this. Anyone can expliain what poll do ?


Regards

Arnaud

--
From: 
Sent: Friday, January 28, 2011 4:53 PM
To: "Daniel P. Berrange" 
Cc: 
Subject: Re: [libvirt] Raising events for testing


Woohoo it will burn my brain :)

--
From: "Daniel P. Berrange" 
Sent: Friday, January 28, 2011 4:24 PM
To: 
Cc: 
Subject: Re: [libvirt] Raising events for testing

On Fri, Jan 28, 2011 at 04:17:21PM +0100, arnaud.champ...@devatom.fr 
wrote:

I suffer with the new callback API :)

Does the new callback API need the EventRegisterImpl call ?


Yes, virEventRegisterImpl is required in order to be able to
receive events.


Can anyone explain me the steps to install these callbacks ? I have
a lot of difficulties to understand the polling process in the
sample, does this polling is mandatory ?


Events can arrive at the client socket from libvirtd at
any time. The poll() is used to watch for events arriving
and ensure immediate dispatch. If we didn't do this no
events would be seen until the next API call was made
which is sub-optimal.

The file daemon/events.c shows a complete C implementation
of the event callbacks.

The file examples/domain-events/events-python/domain-events.py
shows a pure Python implementation

The C example program is a very *bad* demo of poll() so ignore
that and look at daemon/events.c instead.

Daniel



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Raising events for testing

2011-01-29 Thread arnaud.champion
Okay I have understand the use and mean of poll (pollfd... 
bla...bla...bla...)
I have also discover that there is no Win32 equivalent which work with a 
file descriptor (unix way...). Win32 has a select method that can be used to 
emulate the poll function, but the fd_set structure is base on socket and 
not on a file descriptor. Does anyone know a way to have a select or poll 
function that works with file descriptor under windows ? (maybe via mingw, I 
don't know)


Regards,

Arnaud

--
From: 
Sent: Friday, January 28, 2011 7:06 PM
To: "Daniel P. Berrange" 
Cc: 
Subject: Re: [libvirt] Raising events for testing

Okay, I'm trying to understand the Python implentation (I'm not a python 
expert but it seems to be quite readable once you've understand why there 
is "self" everywhere :) ).
The thing I'm not able to understand is the call to the "poll" function as 
this function doesn't exists in C# in any library at my knows... I'm not 
fluent with this. Anyone can expliain what poll do ?


Regards

Arnaud

--
From: 
Sent: Friday, January 28, 2011 4:53 PM
To: "Daniel P. Berrange" 
Cc: 
Subject: Re: [libvirt] Raising events for testing


Woohoo it will burn my brain :)

--
From: "Daniel P. Berrange" 
Sent: Friday, January 28, 2011 4:24 PM
To: 
Cc: 
Subject: Re: [libvirt] Raising events for testing

On Fri, Jan 28, 2011 at 04:17:21PM +0100, arnaud.champ...@devatom.fr 
wrote:

I suffer with the new callback API :)

Does the new callback API need the EventRegisterImpl call ?


Yes, virEventRegisterImpl is required in order to be able to
receive events.


Can anyone explain me the steps to install these callbacks ? I have
a lot of difficulties to understand the polling process in the
sample, does this polling is mandatory ?


Events can arrive at the client socket from libvirtd at
any time. The poll() is used to watch for events arriving
and ensure immediate dispatch. If we didn't do this no
events would be seen until the next API call was made
which is sub-optimal.

The file daemon/events.c shows a complete C implementation
of the event callbacks.

The file examples/domain-events/events-python/domain-events.py
shows a pure Python implementation

The C example program is a very *bad* demo of poll() so ignore
that and look at daemon/events.c instead.

Daniel



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Raising events for testing

2011-01-28 Thread arnaud.champion
Okay, I'm trying to understand the Python implentation (I'm not a python 
expert but it seems to be quite readable once you've understand why there is 
"self" everywhere :) ).
The thing I'm not able to understand is the call to the "poll" function as 
this function doesn't exists in C# in any library at my knows... I'm not 
fluent with this. Anyone can expliain what poll do ?


Regards

Arnaud

--
From: 
Sent: Friday, January 28, 2011 4:53 PM
To: "Daniel P. Berrange" 
Cc: 
Subject: Re: [libvirt] Raising events for testing


Woohoo it will burn my brain :)

--
From: "Daniel P. Berrange" 
Sent: Friday, January 28, 2011 4:24 PM
To: 
Cc: 
Subject: Re: [libvirt] Raising events for testing

On Fri, Jan 28, 2011 at 04:17:21PM +0100, arnaud.champ...@devatom.fr 
wrote:

I suffer with the new callback API :)

Does the new callback API need the EventRegisterImpl call ?


Yes, virEventRegisterImpl is required in order to be able to
receive events.


Can anyone explain me the steps to install these callbacks ? I have
a lot of difficulties to understand the polling process in the
sample, does this polling is mandatory ?


Events can arrive at the client socket from libvirtd at
any time. The poll() is used to watch for events arriving
and ensure immediate dispatch. If we didn't do this no
events would be seen until the next API call was made
which is sub-optimal.

The file daemon/events.c shows a complete C implementation
of the event callbacks.

The file examples/domain-events/events-python/domain-events.py
shows a pure Python implementation

The C example program is a very *bad* demo of poll() so ignore
that and look at daemon/events.c instead.

Daniel



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Raising events for testing

2011-01-28 Thread arnaud.champion

Woohoo it will burn my brain :)

--
From: "Daniel P. Berrange" 
Sent: Friday, January 28, 2011 4:24 PM
To: 
Cc: 
Subject: Re: [libvirt] Raising events for testing

On Fri, Jan 28, 2011 at 04:17:21PM +0100, arnaud.champ...@devatom.fr 
wrote:

I suffer with the new callback API :)

Does the new callback API need the EventRegisterImpl call ?


Yes, virEventRegisterImpl is required in order to be able to
receive events.


Can anyone explain me the steps to install these callbacks ? I have
a lot of difficulties to understand the polling process in the
sample, does this polling is mandatory ?


Events can arrive at the client socket from libvirtd at
any time. The poll() is used to watch for events arriving
and ensure immediate dispatch. If we didn't do this no
events would be seen until the next API call was made
which is sub-optimal.

The file daemon/events.c shows a complete C implementation
of the event callbacks.

The file examples/domain-events/events-python/domain-events.py
shows a pure Python implementation

The C example program is a very *bad* demo of poll() so ignore
that and look at daemon/events.c instead.

Daniel



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Raising events for testing

2011-01-28 Thread arnaud.champion

I suffer with the new callback API :)

Does the new callback API need the EventRegisterImpl call ?

Can anyone explain me the steps to install these callbacks ? I have a lot of 
difficulties to understand the polling process in the sample, does this 
polling is mandatory ?


Help please

Arnaud

--
From: 
Sent: Friday, January 28, 2011 3:46 PM
To: ; "Daniel P. Berrange" 
Cc: 
Subject: Re: [libvirt] Raising events for testing


Weird, only domain lifecycle events works :( I do something wrong...

--
From: 
Sent: Friday, January 28, 2011 2:23 PM
To: "Daniel P. Berrange" 
Cc: 
Subject: Re: [libvirt] Raising events for testing


Many thanks Daniel ! I'll test that

--
From: "Daniel P. Berrange" 
Sent: Friday, January 28, 2011 12:00 PM
To: 
Cc: 
Subject: Re: [libvirt] Raising events for testing

On Thu, Jan 27, 2011 at 11:50:05PM +0100, arnaud.champ...@devatom.fr 
wrote:

?Hi,

I have binded the new API for domain events and callbacks in C#. It 
seems to work (LifeCycle events works for sure, I have tested them). 
Now I want to test other event types and I don't know how to raise them 
for test (RTC change, WatchDog, Graphics and so on...).


Anyone can point me on the right thing I have to do to raise these 
events ?


RTC change -> In your guest OS change the hardware clock
WatchDog - Add a  device to XML and in Linux  'cat 
/dev/watchdog' and wait 60 seconds

Graphics -> Connect to the guest VNC
Reboot  - Reboot the guest
I/O error - Run a guest on NFS with the 'soft,intr' flags on the mount 
point. THen stop the NFS server and do I/O in the guest and wait a while


Daniel



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list





--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Raising events for testing

2011-01-28 Thread arnaud.champion

Weird, only domain lifecycle events works :( I do something wrong...

--
From: 
Sent: Friday, January 28, 2011 2:23 PM
To: "Daniel P. Berrange" 
Cc: 
Subject: Re: [libvirt] Raising events for testing


Many thanks Daniel ! I'll test that

--
From: "Daniel P. Berrange" 
Sent: Friday, January 28, 2011 12:00 PM
To: 
Cc: 
Subject: Re: [libvirt] Raising events for testing

On Thu, Jan 27, 2011 at 11:50:05PM +0100, arnaud.champ...@devatom.fr 
wrote:

?Hi,

I have binded the new API for domain events and callbacks in C#. It 
seems to work (LifeCycle events works for sure, I have tested them). Now 
I want to test other event types and I don't know how to raise them for 
test (RTC change, WatchDog, Graphics and so on...).


Anyone can point me on the right thing I have to do to raise these 
events ?


RTC change -> In your guest OS change the hardware clock
WatchDog - Add a  device to XML and in Linux  'cat 
/dev/watchdog' and wait 60 seconds

Graphics -> Connect to the guest VNC
Reboot  - Reboot the guest
I/O error - Run a guest on NFS with the 'soft,intr' flags on the mount 
point. THen stop the NFS server and do I/O in the guest and wait a while


Daniel



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Raising events for testing

2011-01-28 Thread arnaud.champion

Many thanks Daniel ! I'll test that

--
From: "Daniel P. Berrange" 
Sent: Friday, January 28, 2011 12:00 PM
To: 
Cc: 
Subject: Re: [libvirt] Raising events for testing

On Thu, Jan 27, 2011 at 11:50:05PM +0100, arnaud.champ...@devatom.fr 
wrote:

?Hi,

I have binded the new API for domain events and callbacks in C#. It seems 
to work (LifeCycle events works for sure, I have tested them). Now I want 
to test other event types and I don't know how to raise them for test 
(RTC change, WatchDog, Graphics and so on...).


Anyone can point me on the right thing I have to do to raise these events 
?


RTC change -> In your guest OS change the hardware clock
WatchDog - Add a  device to XML and in Linux  'cat 
/dev/watchdog' and wait 60 seconds

Graphics -> Connect to the guest VNC
Reboot  - Reboot the guest
I/O error - Run a guest on NFS with the 'soft,intr' flags on the mount 
point. THen stop the NFS server and do I/O in the guest and wait a while


Daniel



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] C# bindings need and advice from the experts

2011-01-28 Thread arnaud.champion
?Hi,

I'm working on C# bindings. The goal is to obtain a more C# API for the API 
users.
So I have create object for libvirt familly function (an object Connect, 
Domain, Storage and so on).

All is almost done, but I need and advice about the way to handle object 
properties. For example, for the Connect object, I expose a "RunningDomains" 
property that can be used in this manner :

Connect myConn = new Connect("qemu+tcp://192.168.220.198/system");
List runningDomains = myConn.RunningsDomains;

In the Connect object, the property "RunningDomains" is coded in this :

/// 

/// Get the list of running domains

/// 

public List RunningDomains

{

get

{

if (_conn == IntPtr.Zero) return null;

int nbRunningDomain = NumOfDomains(_conn);

int[] runningDomainIds = new int[nbRunningDomain];

ListDomains(_conn, runningDomainIds, nbRunningDomain);

return runningDomainIds.Select(id => new 
Domain(Domain.LookupByID(_conn, id), this)).ToList();

}

}



So the property call "virConnectNumOfDomains" and "virConnectListDomains" each 
time the property is called. And I don't know if it is a good thing. The other 
way, is to keep the list in the Connect object and handle domain adding or 
removing in this via callbacks. This avoid multiple call to the librar.



Any advice ?



Regards,



Arnaud
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] Raising events for testing

2011-01-27 Thread arnaud.champion
?Hi,

I have binded the new API for domain events and callbacks in C#. It seems to 
work (LifeCycle events works for sure, I have tested them). Now I want to test 
other event types and I don't know how to raise them for test (RTC change, 
WatchDog, Graphics and so on...).

Anyone can point me on the right thing I have to do to raise these events ?

Regards,

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Domain callback, the new way

2011-01-27 Thread arnaud.champion
?Oups, sorry, I have just seen the domain-event sample in source code that show 
to use it. Thanks

Arnaud


From: arnaud.champ...@devatom.fr 
Sent: Thursday, January 27, 2011 9:04 PM
To: libvir-list@redhat.com 
Subject: [libvirt] Domain callback, the new way


Hi,

I'm working on c# bindings, on domain callback. I have successfully binded the 
old way to manage callbacks via the old virConnectDomainEventRegister function. 
Now I'm trying to work with the new API contract with 
virConnectDomainEventRegisterAny... I'm looking for a sample (in C for exemple) 
to see how using these functions, can anyone can explain me how this work ?

Regards,

Arnaud





--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] Domain callback, the new way

2011-01-27 Thread arnaud.champion
?Hi,

I'm working on c# bindings, on domain callback. I have successfully binded the 
old way to manage callbacks via the old virConnectDomainEventRegister function. 
Now I'm trying to work with the new API contract with 
virConnectDomainEventRegisterAny... I'm looking for a sample (in C for exemple) 
to see how using these functions, can anyone can explain me how this work ?

Regards,

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] Interface XML description

2011-01-25 Thread arnaud.champion
?Hi,

I'm currently working on C# binding, precisly on virInterface things. I don't 
see any XML documentation around interface XML description. IS there infos 
anywhere ?

Regards,

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Got time to try out the libvirt 0.8.6 win32 package?

2010-12-20 Thread arnaud.champion

good idea. What about a prefix like "vir_" ?

--
From: "Matthias Bolte" 
Sent: Monday, December 20, 2010 4:03 PM
To: 
Cc: "Justin Clift" ; "libvir-list libvirt" 


Subject: Re: [libvirt] Got time to try out the libvirt 0.8.6 win32 package?


That's correct, regsvr32 is for registering COM components. It has
nothing to do with the runtime linker finding the DLLs.

In order to have libvirt-0.dll available for applications it must
either be in the same directory as the application's binary (having it
in the working directory might work too), or it must be in the PATH.

But putting \bin in the PATH pollutes the global DLL namespace with
common DLLs like zlib1.dll. This makes DLL hell worse. Strawberry Perl
avoids this by making the DLL name unique to Strawberry Perl by
posfixing them with an underscore.

I just hacked a small C program that can rewrite the DLL import
tables. This allows to easily prefix all DLLs in \bin (expect
libvirt-0.dll and libvirt-qemu-0.dll) without touching all the
buildsystems for those DLLs to rename them.

Instead of this filenames in \bin:

iconv.dll
intl.dll
libcurl-4.dll
libgcrypt-11.dll
libgnutls-26.dll
libgpg-error-0.dll
libportablexdr-0.dll
libtasn1-3.dll
libvirt-0.dll
libvirt-qemu-0.dll
libxml2-2.dll
virsh.exe
zlib1.dll

we can have this ones:

libvirt-0.dll
libvirt-qemu-0.dll
virsh.exe
_lv_iconv.dll
_lv_intl.dll
_lv_libcurl-4.dll
_lv_libgcrypt-11.dll
_lv_libgnutls-26.dll
_lv_libgpg-error-0.dll
_lv_libportablexdr-0.dll
_lv_libtasn1-3.dll
_lv_libxml2-2.dll
_lv_zlib1.dll

Or with any other prefix/postfix with up to 4 characters.

Matthias

2010/12/20  :

?Hi Justin,

I don't think regsvr32 will work, as I know, regsvr32 is used to register
COM components against registry, and these dlls are not COM compatible.

Arnaud

--
From: "Justin Clift" 
Sent: Monday, December 20, 2010 6:27 AM
To: "Arnaud Champion" 
Cc: "libvir-list libvirt" 
Subject: Re: [libvirt] Got time to try out the libvirt 0.8.6 win32 
package?



On 12/12/2010, at 9:50 PM, 
 wrote:


Maybe a suggestion (don't know if it is pertinent or not) : when I have
tried C# bindings, I must copy libvirt binaries dll in the C# bindings
directory, so maybe it can be a good idea to add the install path of 
the
/bin dll directory to the PATH environment variable, in this way, no 
more

need to copy dlls.


With this specific problem, do you know if "registering" the dll's be 
the

right approach?

Something like:

   regsvr32.exe /s iconv.dll
   regsvr32.exe /s intl.dll
   regsvr32.exe /s libcurl-4.dll
   regsvr32.exe /s libgcrypt-11.dll
   regsvr32.exe /s libgnutls-26.dll
   regsvr32.exe /s libgpg-error-0.dll
   regsvr32.exe /s libportablexdr-0.dll
   regsvr32.exe /s libtasn1-3.dll
   regsvr32.exe /s libvirt-0.dll
   regsvr32.exe /s libvirt-qemu-0.dll
   regsvr32.exe /s libxml2-2.dll
   regsvr32.exe /s zlib1.dll

(probably with the path names though)

I'm kind of thinking it's the right idea, but am concerned about 
conflict

other applications that might
be using the same libraries (zlib1.dll for example).

Any ideas?

Regards and best wishes,

Justin Clift



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list





--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Got time to try out the libvirt 0.8.6 win32 package?

2010-12-20 Thread arnaud.champion

?Hi Justin,

I don't think regsvr32 will work, as I know, regsvr32 is used to register 
COM components against registry, and these dlls are not COM compatible.


Arnaud

--
From: "Justin Clift" 
Sent: Monday, December 20, 2010 6:27 AM
To: "Arnaud Champion" 
Cc: "libvir-list libvirt" 
Subject: Re: [libvirt] Got time to try out the libvirt 0.8.6 win32 package?

On 12/12/2010, at 9:50 PM,  
 wrote:
Maybe a suggestion (don't know if it is pertinent or not) : when I have 
tried C# bindings, I must copy libvirt binaries dll in the C# bindings 
directory, so maybe it can be a good idea to add the install path of the 
/bin dll directory to the PATH environment variable, in this way, no more 
need to copy dlls.


With this specific problem, do you know if "registering" the dll's be the 
right approach?


Something like:

regsvr32.exe /s iconv.dll
regsvr32.exe /s intl.dll
regsvr32.exe /s libcurl-4.dll
regsvr32.exe /s libgcrypt-11.dll
regsvr32.exe /s libgnutls-26.dll
regsvr32.exe /s libgpg-error-0.dll
regsvr32.exe /s libportablexdr-0.dll
regsvr32.exe /s libtasn1-3.dll
regsvr32.exe /s libvirt-0.dll
regsvr32.exe /s libvirt-qemu-0.dll
regsvr32.exe /s libxml2-2.dll
regsvr32.exe /s zlib1.dll

(probably with the path names though)

I'm kind of thinking it's the right idea, but am concerned about conflict 
other applications that might

be using the same libraries (zlib1.dll for example).

Any ideas?

Regards and best wishes,

Justin Clift 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [C# bindings] [PATCH]

2010-12-16 Thread arnaud.champion



--
From: "Matthias Bolte" 
Sent: Thursday, December 16, 2010 1:44 PM
To: 
Cc: 
Subject: Re: [libvirt] [C# bindings] [PATCH]


2010/12/8  :

Hi there,

a long time since some update for C# bindings, sorry, I'm a little busy.
Anyway here are some patches that correct marshaling around network
functions, and as usual a new sample code related to network functions.



0001-Network-function-marhsalling-corrections.patch:
ACK and pushed it.

There are GetUUIDString functions for other types too, do they need
the same treatment?



Yep, that's right.



0001-New-sample-virNetwork-for-network-related-samples.patch:
Is there a specific reason for naming the new example virNetworkd for
VisualStudio? I think this is a typo. Is that correct, then I will
rename it to virNetworks before pushing it?



Oops my mistake :S sorry. this should be "virNetwork"


The new example leaks _conn and _network. I'd like to see leak free
examples. Just yesterday I fixed a memory leak in the VirtualBox
driver that we inherited from the leaky example code in the VirtualBox
SDK.



:S I haven't understand (my poor english) what mean "leaks" ?



0001-Some-naming-correction-in-samples.patch:
ACK and pushed it.

Matthias



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] system / session URI

2010-12-15 Thread arnaud.champion
?Hi,

Can someone explain (or point me to a document that explain) what are the 
differences between these two URI :

qemu+tcp://xxx.xxx.xxx.xxx/system
qemu+tcp://xxx.xxx.xxx.xxx/session

Regards,

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Got time to try out the libvirt 0.8.6 win32 package?

2010-12-12 Thread arnaud.champion
?I'm use to create msi packages with visual studio, I've never tried NSIS 
but I think I can help. I'm a little bit busy these times but I will give it 
a try.


Arnaud

--
From: "Justin Clift" 
Sent: Sunday, December 12, 2010 6:13 PM
To: "Arnaud Champion" 
Cc: "Matthias Bolte" ; "libvir-list libvirt" 


Subject: Re: [libvirt] Got time to try out the libvirt 0.8.6 win32 package?

On 12/12/2010, at 9:50 PM,  
 wrote:

?Okay, I have tested it.

At first, this works fine. No install problem, I have installed every 
thing (python bindings, virsh and dev components).


I have tested virsh with tcp+qemu and esx URI, both works fine.
I have also tested with C# libvirt bindings without surprise.


Thanks Arnaud, those are the important bits at this stage. :)


Maybe a suggestion (don't know if it is pertinent or not) : when I have 
tried C# bindings, I must copy libvirt binaries dll in the C# bindings 
directory, so maybe it can be a good idea to add the install path of the 
/bin dll directory to the PATH environment variable, in this way, no more 
need to copy dlls.


Sounds like a good idea.  I'm not sure how to do that with NSIS (yet), but 
it should be possible.


At the moment, I'm thinking that since the installer "works", to use this 
one as it is.  But, we'll update the Windows page to mention it needs to 
be added to the path.


When I (or anyone willing) gets a chance to fix the installer, so it 
updates the path, then we'll can generate a new installer and use that.


Do you have any desire to create the Windows packages?  Kind of thinking 
that you already know how to create .msi's... :)


Regards and best wishes,

Justin Clift




--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Got time to try out the libvirt 0.8.6 win32 package?

2010-12-12 Thread arnaud.champion

?Okay, I have tested it.

At first, this works fine. No install problem, I have installed every thing 
(python bindings, virsh and dev components).


I have tested virsh with tcp+qemu and esx URI, both works fine.
I have also tested with C# libvirt bindings without surprise.

Maybe a suggestion (don't know if it is pertinent or not) : when I have 
tried C# bindings, I must copy libvirt binaries dll in the C# bindings 
directory, so maybe it can be a good idea to add the install path of the 
/bin dll directory to the PATH environment variable, in this way, no more 
need to copy dlls.


Arnaud

--
From: 
Sent: Sunday, December 12, 2010 11:25 AM
To: "Justin Clift" ; "Matthias Bolte" 


Cc: "libvir-list libvirt" 
Subject: Re: [libvirt] Got time to try out the libvirt 0.8.6 win32 package?


?Nice :)

I will test this as soon as possible

Arnaud

--
From: "Justin Clift" 
Sent: Sunday, December 12, 2010 9:46 AM
To: "Matthias Bolte" 
Cc: "libvir-list libvirt" 
Subject: [libvirt] Got time to try out the libvirt 0.8.6 win32 package?


Hi Matthias (and anyone else interested),

Just added a win32 installation package to the website, for libvirt 
0.8.6.


 http://libvirt.org/sources/win32_experimental/Libvirt-0.8.6-0.exe

This has the libcurl stuff in it you put together, so (in theory) it 
should

connect to remote vSphere/ESX servers.

Do you (or anyone) have time to try it out against vSphere/ESX/similar?

Going to update the Windows page on the website pointing to it, when
we know it's working ok. :)

Regards and best wishes,

Justin Clift

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Got time to try out the libvirt 0.8.6 win32 package?

2010-12-12 Thread arnaud.champion

?Nice :)

I will test this as soon as possible

Arnaud

--
From: "Justin Clift" 
Sent: Sunday, December 12, 2010 9:46 AM
To: "Matthias Bolte" 
Cc: "libvir-list libvirt" 
Subject: [libvirt] Got time to try out the libvirt 0.8.6 win32 package?


Hi Matthias (and anyone else interested),

Just added a win32 installation package to the website, for libvirt 0.8.6.

 http://libvirt.org/sources/win32_experimental/Libvirt-0.8.6-0.exe

This has the libcurl stuff in it you put together, so (in theory) it 
should

connect to remote vSphere/ESX servers.

Do you (or anyone) have time to try it out against vSphere/ESX/similar?

Going to update the Windows page on the website pointing to it, when
we know it's working ok. :)

Regards and best wishes,

Justin Clift

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [C# bindings][PATCH]

2010-12-07 Thread arnaud.champion
?Hi,

here is another patch for C# bindings. I have update our project DAVIM with 
latest C# bindings and it show some naming errors. This patch correct it.

Arnaud

0001-Naming-update-in-Node-and-StoragePool-classes.patch
Description: Binary data
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [C# bindings][Pathces] Marshaling corrections, coverage and new sample

2010-11-25 Thread arnaud.champion

Hi Matthias,

sorry for the response delay I've been very busy.

I was also surprised that this marshaling works without IntPtr, anyway I 
have double check results against virsh unde Windows/.Net, Windows/Mono, 
Ubuntu 10.10/Mono (64 bits) and it works fine.

Anyway, I can try to put IntPtr to be coherent. What do you think ?

Regards,

Arnaud

--
From: "Matthias Bolte" 
Sent: Monday, November 15, 2010 5:52 PM
To: 
Cc: 
Subject: Re: [libvirt] [C# bindings][Pathces] Marshaling corrections, 
coverage and new sample



2010/11/13  :

Hi there,

here are some new patches for the C# bindings.
These patches correct marshaling in domain statistics (block / interface 
/

info) and error structure. These parches also add a new sample code.
I have included the coverage also.

regards,

Arnaud



Okay, I pushed the 0001-Correct-virGetLastError-marshaling.patch.

The 0001-Add-sample-virDomainStats.patch depends on the
0001-Correct-virDomainBlockStats-virDomainInterfaceStats-.patch.

In 0001-Correct-virDomainBlockStats-virDomainInterfaceStats-.patch you
used UnmanagedType.SysUInt to marshal a ulong in NodeInfo. This fixes
the problem with long having different sizes on 32bit and 64bit
systems. But for some reason you used UnmanagedType.I8 to marshal long
in DomainInterfaceStatsStruct and DomainBlockStatsStruct. I think this
is wrong on 32bit systems and should be UnmanagedType.SysInt instead,
shouldn't it?

Also this comment "// TODO virDomainMemoryStats : Currently disabled
in libvirt" is wrong. It's not disabled in libvirt, it's disabled in
QEMU.

0001-Forgot-comments-on-new-sample.patch is just an incremental fix
for 0001-Add-sample-virDomainStats.patch and I'll squash the fix into
it when I can push it.

Matthias 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Experimental 32-bit windows libvirt installer

2010-11-14 Thread arnaud.champion

?Well, I understand :) For me, VS is my usual development tools so... :)


--
From: "Justin Clift" 
Sent: Sunday, November 14, 2010 4:41 PM
To: 
Cc: ; "Matthias Bolte" 


Subject: Re: Experimental 32-bit windows libvirt installer


On 15/11/2010, at 2:38 AM,  wrote:
?I have used visual studio 2010 to create a standard setup, but for now 
it just provide dll, no virsh but why not...

GAC inscription is now next goal. I'll try to see that this week.


Heh, no worries.  I'll look around for an open source tool that does it 
instead,
as using Visual Studio 2010 just for creating an installer seems like a 
bit
of overkill (for me). :) 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Experimental 32-bit windows libvirt installer

2010-11-14 Thread arnaud.champion
?I have used visual studio 2010 to create a standard setup, but for now it 
just provide dll, no virsh but why not...

GAC inscription is now next goal. I'll try to see that this week.

Arnaud
--
From: "Justin Clift" 
Sent: Sunday, November 14, 2010 4:21 PM
To: 
Cc: ; "Matthias Bolte" 


Subject: Re: Experimental 32-bit windows libvirt installer


On 15/11/2010, at 1:45 AM,  wrote:

?Hi Justin,

I have made a MSI/EXE installer with these libs also for my personal use. 
I don't know if it can help.


Sure.  Which installer creation package did you use?

I haven't yet looked around for something better than NSIS, but will 
shortly. :)



I think it could be a good idea to include C# bindings in the installer, 
but for that, I have to work on the GAC inscription of the bindings...


Ok.  I'd like to include them too.  If you have time to work on the GAC 
bit, then we can package them when you say they're ready. :)




I'll take a look on your installer, and give a return.

Nice to see that anyway, I have searched for it a year ago ;)


Yeah.  Hoping to make this easier for future developers over time. :) 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Experimental 32-bit windows libvirt installer

2010-11-14 Thread arnaud.champion
?It seems your libvirt hasn't been compiled with esx support. No problem at 
all, but if you add the esx support you also need the libcurl dll.


Arnaud

--
From: 
Sent: Sunday, November 14, 2010 3:45 PM
To: "Justin Clift" ; 
Subject: Re: [libvirt] Experimental 32-bit windows libvirt installer


?Hi Justin,

I have made a MSI/EXE installer with these libs also for my personal use. 
I don't know if it can help.


I think it could be a good idea to include C# bindings in the installer, 
but for that, I have to work on the GAC inscription of the bindings...


I'll take a look on your installer, and give a return.

Nice to see that anyway, I have searched for it a year ago ;)

Arnaud

--
From: "Justin Clift" 
Sent: Sunday, November 14, 2010 3:18 PM
To: 
Cc: "Matthias Bolte" ; 


Subject: Experimental 32-bit windows libvirt installer


Hi all,

If people have time to try out a tentative first "Libvirt Windows 
Installer", it's

online here:

 http://libvirt.org/sources/win32_experimental/Libvirt-0.8.5-0.exe

At the moment it includes the libvirt development headers and libraries
for compiling against, plus the virsh shell with it's needed 
dependencies,

and that's about it.

It's been compiled on Windows 7 x86_64, but (in theory) might also work
on earlier windows versions like Vista and XP. (not yet tested)

A couple of notes:

+ This installer is _not_ production ready.  More like early, early stage
   alpha. ;)

+ This installer just repackages the files compiled using Matthias
   Bolte's msys_setup scripting:

 https://github.com/photron/msys_setup

+ This is a .exe installer, created using NSIS.  Mathias Bolte mentioned,
   it might be a better idea to use something that creates .msi files, 
which
   I kind of agree with.  So, next versions will probably not be NSIS 
based,

   but no idea what they will be based upon yet.

+ The only connection type I've tried, and that's known to work for sure,
   is qemu+tcp://.  qemu+ssh:// doesn't work on windows (at this stage),
   and qemu+tls:// (on windows) doesn't work due to a problem with
   GnuTLS.

   If anyone has time to look into the GnuTLS problem, that would be 
really

   helpful. :)

+ This version includes Python bindings, but I haven't tried/tested them. 
:)


+ Suggestions for what else to include are welcome.  ie. other bindings 
(C#,

what else?), and so on

+ The NSIS installer scripting is on github if anyone's interested:

 https://github.com/justinclift/nsis_libvirt_installer

Regards and best wishes,

Justin Clift



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Experimental 32-bit windows libvirt installer

2010-11-14 Thread arnaud.champion

?Hi Justin,

I have made a MSI/EXE installer with these libs also for my personal use. I 
don't know if it can help.


I think it could be a good idea to include C# bindings in the installer, but 
for that, I have to work on the GAC inscription of the bindings...


I'll take a look on your installer, and give a return.

Nice to see that anyway, I have searched for it a year ago ;)

Arnaud

--
From: "Justin Clift" 
Sent: Sunday, November 14, 2010 3:18 PM
To: 
Cc: "Matthias Bolte" ; 


Subject: Experimental 32-bit windows libvirt installer


Hi all,

If people have time to try out a tentative first "Libvirt Windows 
Installer", it's

online here:

 http://libvirt.org/sources/win32_experimental/Libvirt-0.8.5-0.exe

At the moment it includes the libvirt development headers and libraries
for compiling against, plus the virsh shell with it's needed dependencies,
and that's about it.

It's been compiled on Windows 7 x86_64, but (in theory) might also work
on earlier windows versions like Vista and XP. (not yet tested)

A couple of notes:

+ This installer is _not_ production ready.  More like early, early stage
   alpha. ;)

+ This installer just repackages the files compiled using Matthias
   Bolte's msys_setup scripting:

 https://github.com/photron/msys_setup

+ This is a .exe installer, created using NSIS.  Mathias Bolte mentioned,
   it might be a better idea to use something that creates .msi files, 
which
   I kind of agree with.  So, next versions will probably not be NSIS 
based,

   but no idea what they will be based upon yet.

+ The only connection type I've tried, and that's known to work for sure,
   is qemu+tcp://.  qemu+ssh:// doesn't work on windows (at this stage),
   and qemu+tls:// (on windows) doesn't work due to a problem with
   GnuTLS.

   If anyone has time to look into the GnuTLS problem, that would be 
really

   helpful. :)

+ This version includes Python bindings, but I haven't tried/tested them. 
:)


+ Suggestions for what else to include are welcome.  ie. other bindings 
(C#,

what else?), and so on

+ The NSIS installer scripting is on github if anyone's interested:

 https://github.com/justinclift/nsis_libvirt_installer

Regards and best wishes,

Justin Clift 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] Fw: CSharp bindings patch

2010-11-14 Thread arnaud.champion
?Hi,

here is a 2nd patch to correct marshaling around virError.

Regards,

Arnaud

0001-Correct-virGetLastError-marshaling.patch
Description: Binary data
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] Fw: CSharp Bindings Patch to correct some marshaling

2010-11-14 Thread arnaud.champion
?Hi,

Here is a new C# bindings patch to correct some marshaling mistakes around 
domain statistics.

Regards,
Arnaud

0001-Correct-virDomainBlockStats-virDomainInterfaceStats-.patch
Description: Binary data
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] CSharp bindings patch

2010-11-14 Thread arnaud.champion
?Hi,

here is a patch because I have forgotten to include comments on sample

Regards,

Arnaud

0001-Forgot-comments-on-new-sample.patch
Description: Binary data
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] dommemstat return nothing

2010-11-11 Thread arnaud.champion

?Okay, thanks for the info.

Regards,

Arnaud

--
From: "Daniel P. Berrange" 
Sent: Thursday, November 11, 2010 11:40 AM
To: 
Cc: 
Subject: Re: [libvirt] dommemstat return nothing

On Thu, Nov 11, 2010 at 10:37:08AM +0100, arnaud.champ...@devatom.fr 
wrote:

?Hi,

I'm currently working on dommemstat C# bindings, and I have a little
problem, with virsh under fedora or under linux,  dommemstat return
nothing. Is it normal ? A suggestion ?


Yes, this functionality had to be disabled in QEMU because of a design
flaw.  It will be reenabled in the future

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




--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] dommemstat return nothing

2010-11-11 Thread arnaud.champion
?Hi,

I'm currently working on dommemstat C# bindings, and I have a little problem, 
with virsh under fedora or under linux,  dommemstat return nothing. Is it 
normal ? A suggestion ?

Regards,

Arnaud Champion--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] virDomainInterfaceStatsStruct documentation

2010-11-04 Thread arnaud.champion
?Hi,

I'm working on marshaling virDomainInterfaceStatsStruct for C#, and the 
document miss the struct member explaination. Can anyone explain me the struct 
members ?

Regards,

Arnaud
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] virDomainMemoryStats help

2010-11-04 Thread arnaud.champion
?Hmm,

it seems that even virDomainMemoryStats with virsh.exe under windows doesn't 
work.

Arnaud


From: arnaud.champ...@devatom.fr 
Sent: Thursday, November 04, 2010 12:32 PM
To: libvir-list@redhat.com 
Subject: [libvirt] virDomainMemoryStats help


Hi,

I need a little help about "virDomainMemoryStats" method.
I'm trying to bind it for csharp, and I don't understand the parameter "stats" 
of the method.

Should this array be filled with desired memory statistics or is it fully 
returned by the method ?

Can anyone make a little C sample code that I can understand ?

Regards,

Arnaud





--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] virDomainMemoryStats help

2010-11-04 Thread arnaud.champion
?Hi,

I need a little help about "virDomainMemoryStats" method.
I'm trying to bind it for csharp, and I don't understand the parameter "stats" 
of the method.

Should this array be filled with desired memory statistics or is it fully 
returned by the method ?

Can anyone make a little C sample code that I can understand ?

Regards,

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] SPAM-LOW: Re: Re: SPAM-LOW: Re: Re: Node.GetInfo error

2010-11-02 Thread arnaud.champion
Maybe this is because DOmain.cs has been modified :S


From: 黄亮 
Sent: Tuesday, November 02, 2010 2:32 AM
To: Matthias Bolte ; jclift 
Cc: arnaud.champion ; libvir-list 
Subject: SPAM-LOW: Re: Re: [libvirt] SPAM-LOW: Re: Re: Node.GetInfo error


Well, I removed the ">", and yes it goes a few steps further but it still fail 
to apply
the error msg is :

fatal: sha1 information is lacking or useless (Domain.cs).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.

so what can I do?

Regards

2010-11-02 



Lancer 



发件人: Matthias Bolte 
发送时间: 2010-11-02  04:12:50 
收件人: jclift 
抄送: arnaud.champion; libvir-list; lancerhuang 
主题: Re: [libvirt] SPAM-LOW: Re: Re: Node.GetInfo error 
Ah, now I get what Arnaud meant in his other mail.
For some reason the first line in his patches has ">" in front of the
"From". Manually removing that ">" helps.
Matthias
2010/11/1  :
> I sometimes get a similar error with git patches from email, if I use
> Thunderbird to save them.
> Thunderbird spreads the header information into several lines, so I need to
> manually adjust that after saving, with a text editor.
> Maybe that's the problem here too? :)
> On 02/11/2010, at 3:00 AM,  wrote:
>
> :S I'm far away from a git expert :S
>
> Maybe anyone on the list can help us ?
>
> Arnaud
> From: 黄亮
> Sent: Monday, November 01, 2010 2:42 PM
> To: arnaud.champ...@devatom.fr
> Subject: Re: Re: Re: SPAM-LOW: Re: Re: Node.GetInfo error
> Hi Arnaud,
>
> I tried GitExtension, but while applying patch, it returns
> "Patch format detection failed. "
>
> Should I change some settings or is there something not right in the patch
> file?
>
> Regards
>
>
> 2010-11-01
> 
> Lancer
> 
> 发件人: arnaud.champ...@devatom.fr
> 发送时间: 2010-11-01  16:55:51
> 收件人: 黄亮
> 抄送: libvir-list@redhat.com
> 主题: Re: Re: SPAM-LOW: Re: Re: Node.GetInfo error
> Ok,
>
> if you are under windows (like me), use GitExtension
> (http://sourceforge.net/projects/gitextensions/)
> It works, not perfect, but it works.
>
> Arnaud
> From: 黄亮
> Sent: Monday, November 01, 2010 9:52 AM
> To: arnaud.champ...@devatom.fr
> Subject: Re: Re: SPAM-LOW: Re: Re: Node.GetInfo error
> Hi Arnaud,
>
> The NodeInfoStructure you sent to me yesterday works, thank you.
> I saw your patch file, should I manually apply it to the source code or is
> there some tools I can use to automatically apply the changes?
>
> Regards
>
>
> 2010-11-01
> 
> Lancer
> 
> 发件人: arnaud.champ...@devatom.fr
> 发送时间: 2010-11-01  16:37:17
> 收件人: 黄亮
> 抄送: libvir-list
> 主题: Re: SPAM-LOW: Re: Re: Node.GetInfo error
> Hi,
> I think the solution is in the last patches I have send (which are not yet
> in the git). Have you tried the NodeInfoStructure I have sended yesterday ?
>
> Arnaud
> From: 黄亮
> Sent: Monday, November 01, 2010 3:01 AM
> To: arnaud.champ...@devatom.fr
> Cc: libvir-list
> Subject: SPAM-LOW: Re: Re: Node.GetInfo error
> HI,
>
> I tried
>
> Errors.Error err = Errors.GetLastError();
> MessageBox.Show(err.Message);
>
> But  IDE shows compilation errors that there is no "Error" defination in
> "Errors", and "Errors.GetLastError()" returns int.
> I made a guess that maybe it was like this:
>
> Error err = Errors.SaveLastError();
> MessageBox.Show("Get Info error: " + err.Message);
>
> It can be compiled but "err.Message" has nothing in it.
>
> Did I make a wrong assumption?
>
> Regards
>
>
> 2010-11-01
> 
> Lancer
> 
> 发件人: arnaud.champ...@devatom.fr
> 发送时间: 2010-10-31  16:48:15
> 收件人: 黄亮
> 抄送: libvir-list@redhat.com
> 主题: Re: Node.GetInfo error
> Ok,
>
> at first GetLastError return an Error object. So you should anything like :
>
> Errors.Error err = Errors.GetLastError();
> MessageBox.Show(err.Message);
>
> For the NodeInfo structure, I think the problem is the same that was for
> DomainInfo, I'll check marshaling. Then respond you with the correct infos.
>
> Arnaud
>
> PS : can you also put libvirt-l...@redhat.com in copy of your mails, to keep
> everyone in the loop ?
> From: 黄亮
> Sent: Sunday, October 31, 2010 8:20 AM
> To: arnaud.champion
> Subject: Node.GetInfo error
> Hi,
>
> Sorry for disturbing again. But I get error while 

Re: [libvirt] SPAM-LOW: Re: Re: SPAM-LOW: Re: Re: Node.GetInfo error

2010-11-02 Thread arnaud.champion
:S Can't you help you here... I hope the patches will be in the git today...

Arnaud


From: 黄亮 
Sent: Tuesday, November 02, 2010 2:32 AM
To: Matthias Bolte ; jclift 
Cc: arnaud.champion ; libvir-list 
Subject: SPAM-LOW: Re: Re: [libvirt] SPAM-LOW: Re: Re: Node.GetInfo error


Well, I removed the ">", and yes it goes a few steps further but it still fail 
to apply
the error msg is :

fatal: sha1 information is lacking or useless (Domain.cs).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.

so what can I do?

Regards

2010-11-02 



Lancer 



发件人: Matthias Bolte 
发送时间: 2010-11-02  04:12:50 
收件人: jclift 
抄送: arnaud.champion; libvir-list; lancerhuang 
主题: Re: [libvirt] SPAM-LOW: Re: Re: Node.GetInfo error 
Ah, now I get what Arnaud meant in his other mail.
For some reason the first line in his patches has ">" in front of the
"From". Manually removing that ">" helps.
Matthias
2010/11/1  :
> I sometimes get a similar error with git patches from email, if I use
> Thunderbird to save them.
> Thunderbird spreads the header information into several lines, so I need to
> manually adjust that after saving, with a text editor.
> Maybe that's the problem here too? :)
> On 02/11/2010, at 3:00 AM,  wrote:
>
> :S I'm far away from a git expert :S
>
> Maybe anyone on the list can help us ?
>
> Arnaud
> From: 黄亮
> Sent: Monday, November 01, 2010 2:42 PM
> To: arnaud.champ...@devatom.fr
> Subject: Re: Re: Re: SPAM-LOW: Re: Re: Node.GetInfo error
> Hi Arnaud,
>
> I tried GitExtension, but while applying patch, it returns
> "Patch format detection failed. "
>
> Should I change some settings or is there something not right in the patch
> file?
>
> Regards
>
>
> 2010-11-01
> 
> Lancer
> 
> 发件人: arnaud.champ...@devatom.fr
> 发送时间: 2010-11-01  16:55:51
> 收件人: 黄亮
> 抄送: libvir-list@redhat.com
> 主题: Re: Re: SPAM-LOW: Re: Re: Node.GetInfo error
> Ok,
>
> if you are under windows (like me), use GitExtension
> (http://sourceforge.net/projects/gitextensions/)
> It works, not perfect, but it works.
>
> Arnaud
> From: 黄亮
> Sent: Monday, November 01, 2010 9:52 AM
> To: arnaud.champ...@devatom.fr
> Subject: Re: Re: SPAM-LOW: Re: Re: Node.GetInfo error
> Hi Arnaud,
>
> The NodeInfoStructure you sent to me yesterday works, thank you.
> I saw your patch file, should I manually apply it to the source code or is
> there some tools I can use to automatically apply the changes?
>
> Regards
>
>
> 2010-11-01
> 
> Lancer
> 
> 发件人: arnaud.champ...@devatom.fr
> 发送时间: 2010-11-01  16:37:17
> 收件人: 黄亮
> 抄送: libvir-list
> 主题: Re: SPAM-LOW: Re: Re: Node.GetInfo error
> Hi,
> I think the solution is in the last patches I have send (which are not yet
> in the git). Have you tried the NodeInfoStructure I have sended yesterday ?
>
> Arnaud
> From: 黄亮
> Sent: Monday, November 01, 2010 3:01 AM
> To: arnaud.champ...@devatom.fr
> Cc: libvir-list
> Subject: SPAM-LOW: Re: Re: Node.GetInfo error
> HI,
>
> I tried
>
> Errors.Error err = Errors.GetLastError();
> MessageBox.Show(err.Message);
>
> But  IDE shows compilation errors that there is no "Error" defination in
> "Errors", and "Errors.GetLastError()" returns int.
> I made a guess that maybe it was like this:
>
> Error err = Errors.SaveLastError();
> MessageBox.Show("Get Info error: " + err.Message);
>
> It can be compiled but "err.Message" has nothing in it.
>
> Did I make a wrong assumption?
>
> Regards
>
>
> 2010-11-01
> 
> Lancer
> 
> 发件人: arnaud.champ...@devatom.fr
> 发送时间: 2010-10-31  16:48:15
> 收件人: 黄亮
> 抄送: libvir-list@redhat.com
> 主题: Re: Node.GetInfo error
> Ok,
>
> at first GetLastError return an Error object. So you should anything like :
>
> Errors.Error err = Errors.GetLastError();
> MessageBox.Show(err.Message);
>
> For the NodeInfo structure, I think the problem is the same that was for
> DomainInfo, I'll check marshaling. Then respond you with the correct infos.
>
> Arnaud
>
> PS : can you also put libvirt-l...@redhat.com in copy of your mails, to keep
> everyone in the loop ?
> From: 黄亮
> Sent: Sunday, October 31, 2010 8:20 AM
> To: arnaud.champion
> Subject: Node.GetInfo error
> Hi,
>

Re: [libvirt] [C# bindings][PATCH] Add/Clean comments and virConnecSetErrorFunc Sample

2010-11-01 Thread arnaud.champion

Okay,

thanks for explaination, I've always been used to work alone, so I have a 
lot of things to learn.


Regards,

Arnaud

--
From: "Matthias Bolte" 
Sent: Monday, November 01, 2010 9:07 PM
To: 
Cc: 
Subject: Re: [libvirt] [C# bindings][PATCH] Add/Clean comments and 
virConnecSetErrorFunc Sample



Your patches in general are okay, no problem with that. :)

It's just that this patch contains 3 independent changes. As a general
rule of thumb you should do one thing per commit. This makes things
simpler to review and track.

Also the "Correct virDomainInfo marshaling" part could be explained in
a bit more details in the commit message. Like try to answer the
question: What was wrong with it and how did you fix it?

Matthias

2010/11/1  :

Okay,

anyway, I think my patches are not well formatted and/or sometime
"inconsistent" I don't know the well word.

Can you explain me what is a "good" patch, just for make less work for 
you ?


Regards,

Arnaud

--
From: "Matthias Bolte" 
Sent: Monday, November 01, 2010 7:15 PM
To: 
Cc: 
Subject: Re: [libvirt] [C# bindings][PATCH] Add/Clean comments and
virConnecSetErrorFunc Sample


2010/10/30  :


Hi,

here is a new patch, it add/correct some comments. It also make
virDomainInfo marshaling working. It also add a new sample
virConnectSetErrorFunc to show usage of virConnectSetErrorFunc, 
virError

struct, virDomainInfo struct.

Regards,

Arnaud



Actually this patch contains 3 independent things:

- Add / cleaning comments
- New sample virConnectSetErrorFunc
- Correct virDomainInfo marshaling

Therefore, I'd like to see this split up into 3 separate patches.

Matthias








--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [C# bindings][PATCH] Add/Clean comments and virConnecSetErrorFunc Sample

2010-11-01 Thread arnaud.champion

Okay,

anyway, I think my patches are not well formatted and/or sometime 
"inconsistent" I don't know the well word.


Can you explain me what is a "good" patch, just for make less work for you ?

Regards,

Arnaud

--
From: "Matthias Bolte" 
Sent: Monday, November 01, 2010 7:15 PM
To: 
Cc: 
Subject: Re: [libvirt] [C# bindings][PATCH] Add/Clean comments and 
virConnecSetErrorFunc Sample



2010/10/30  :

Hi,

here is a new patch, it add/correct some comments. It also make
virDomainInfo marshaling working. It also add a new sample
virConnectSetErrorFunc to show usage of virConnectSetErrorFunc, virError
struct, virDomainInfo struct.

Regards,

Arnaud



Actually this patch contains 3 independent things:

- Add / cleaning comments
- New sample virConnectSetErrorFunc
- Correct virDomainInfo marshaling

Therefore, I'd like to see this split up into 3 separate patches.

Matthias



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] SPAM-LOW: Re: Re: Node.GetInfo error

2010-11-01 Thread arnaud.champion
?:S I'm far away from a git expert :S

Maybe anyone on the list can help us ?

Arnaud


From: 黄亮 
Sent: Monday, November 01, 2010 2:42 PM
To: arnaud.champ...@devatom.fr 
Subject: Re: Re: Re: SPAM-LOW: Re: Re: Node.GetInfo error


Hi Arnaud,

I tried GitExtension, but while applying patch, it returns "Patch format 
detection failed. "

Should I change some settings or is there something not right in the patch file?

Regards


2010-11-01 



Lancer 



发件人: arnaud.champ...@devatom.fr 
发送时间: 2010-11-01  16:55:51 
收件人: 黄亮 
抄送: libvir-list@redhat.com 
主题: Re: Re: SPAM-LOW: Re: Re: Node.GetInfo error 
Ok,

if you are under windows (like me), use GitExtension 
(http://sourceforge.net/projects/gitextensions/)
It works, not perfect, but it works.

Arnaud


From: 黄亮 
Sent: Monday, November 01, 2010 9:52 AM
To: arnaud.champ...@devatom.fr 
Subject: Re: Re: SPAM-LOW: Re: Re: Node.GetInfo error


Hi Arnaud,

The NodeInfoStructure you sent to me yesterday works, thank you.
I saw your patch file, should I manually apply it to the source code or is 
there some tools I can use to automatically apply the changes? 

Regards


2010-11-01 



Lancer 



发件人: arnaud.champ...@devatom.fr 
发送时间: 2010-11-01  16:37:17 
收件人: 黄亮 
抄送: libvir-list 
主题: Re: SPAM-LOW: Re: Re: Node.GetInfo error 
Hi,
I think the solution is in the last patches I have send (which are not yet in 
the git). Have you tried the NodeInfoStructure I have sended yesterday ?

Arnaud


From: 黄亮 
Sent: Monday, November 01, 2010 3:01 AM
To: arnaud.champ...@devatom.fr 
Cc: libvir-list 
Subject: SPAM-LOW: Re: Re: Node.GetInfo error


HI,

I tried 

Errors.Error err = Errors.GetLastError();
MessageBox.Show(err.Message);

But  IDE shows compilation errors that there is no "Error" defination in 
"Errors", and "Errors.GetLastError()" returns int.
I made a guess that maybe it was like this:

Error err = Errors.SaveLastError();
MessageBox.Show("Get Info error: " + err.Message);

It can be compiled but "err.Message" has nothing in it.

Did I make a wrong assumption?

Regards


2010-11-01 



Lancer 



发件人: arnaud.champ...@devatom.fr 
发送时间: 2010-10-31  16:48:15 
收件人: 黄亮 
抄送: libvir-list@redhat.com 
主题: Re: Node.GetInfo error 
Ok,

at first GetLastError return an Error object. So you should anything like :

Errors.Error err = Errors.GetLastError();
MessageBox.Show(err.Message);

For the NodeInfo structure, I think the problem is the same that was for 
DomainInfo, I'll check marshaling. Then respond you with the correct infos.

Arnaud

PS : can you also put libvirt-l...@redhat.com in copy of your mails, to keep 
everyone in the loop ?


From: 黄亮 
Sent: Sunday, October 31, 2010 8:20 AM
To: arnaud.champion 
Subject: Node.GetInfo error


Hi,

Sorry for disturbing again. But I get error while using Node.GetInfo.

Code:

NodeInfo aNodeInfo = new NodeInfo();
if (Node.GetInfo(con, aNodeInfo) < 0)
{
//MessageBox.Show("Node Info Error");
MessageBox.Show(Errors.GetLastError().ToString());
return 0f;
}

I'm sure con != IntPtr.Zero. I tried to use Errors.GetLastError(), it returns 
int. But I don't know what to do with it.
So, any suggestions ? Thanks 

Regards
2010-10-31 



Lancer 


__ Information from ESET Smart Security, version of virus signature 
database 5577 (20101030) __

The message was checked by ESET Smart Security.

http://www.eset.com



__ Information from ESET Smart Security, version of virus signature 
database 5580 (20101031) __

The message was checked by ESET Smart Security.

http://www.eset.com
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] SPAM-LOW: Re: Re: Node.GetInfo error

2010-11-01 Thread arnaud.champion
?Ok,

if you are under windows (like me), use GitExtension 
(http://sourceforge.net/projects/gitextensions/)
It works, not perfect, but it works.

Arnaud


From: 黄亮 
Sent: Monday, November 01, 2010 9:52 AM
To: arnaud.champ...@devatom.fr 
Subject: Re: Re: SPAM-LOW: Re: Re: Node.GetInfo error


Hi Arnaud,

The NodeInfoStructure you sent to me yesterday works, thank you.
I saw your patch file, should I manually apply it to the source code or is 
there some tools I can use to automatically apply the changes? 

Regards


2010-11-01 



Lancer 



发件人: arnaud.champ...@devatom.fr 
发送时间: 2010-11-01  16:37:17 
收件人: 黄亮 
抄送: libvir-list 
主题: Re: SPAM-LOW: Re: Re: Node.GetInfo error 
Hi,
I think the solution is in the last patches I have send (which are not yet in 
the git). Have you tried the NodeInfoStructure I have sended yesterday ?

Arnaud


From: 黄亮 
Sent: Monday, November 01, 2010 3:01 AM
To: arnaud.champ...@devatom.fr 
Cc: libvir-list 
Subject: SPAM-LOW: Re: Re: Node.GetInfo error


HI,

I tried 

Errors.Error err = Errors.GetLastError();
MessageBox.Show(err.Message);

But  IDE shows compilation errors that there is no "Error" defination in 
"Errors", and "Errors.GetLastError()" returns int.
I made a guess that maybe it was like this:

Error err = Errors.SaveLastError();
MessageBox.Show("Get Info error: " + err.Message);

It can be compiled but "err.Message" has nothing in it.

Did I make a wrong assumption?

Regards


2010-11-01 



Lancer 



发件人: arnaud.champ...@devatom.fr 
发送时间: 2010-10-31  16:48:15 
收件人: 黄亮 
抄送: libvir-list@redhat.com 
主题: Re: Node.GetInfo error 
Ok,

at first GetLastError return an Error object. So you should anything like :

Errors.Error err = Errors.GetLastError();
MessageBox.Show(err.Message);

For the NodeInfo structure, I think the problem is the same that was for 
DomainInfo, I'll check marshaling. Then respond you with the correct infos.

Arnaud

PS : can you also put libvirt-l...@redhat.com in copy of your mails, to keep 
everyone in the loop ?


From: 黄亮 
Sent: Sunday, October 31, 2010 8:20 AM
To: arnaud.champion 
Subject: Node.GetInfo error


Hi,

Sorry for disturbing again. But I get error while using Node.GetInfo.

Code:

NodeInfo aNodeInfo = new NodeInfo();
if (Node.GetInfo(con, aNodeInfo) < 0)
{
//MessageBox.Show("Node Info Error");
MessageBox.Show(Errors.GetLastError().ToString());
return 0f;
}

I'm sure con != IntPtr.Zero. I tried to use Errors.GetLastError(), it returns 
int. But I don't know what to do with it.
So, any suggestions ? Thanks 

Regards
2010-10-31 



Lancer 


__ Information from ESET Smart Security, version of virus signature 
database 5577 (20101030) __

The message was checked by ESET Smart Security.

http://www.eset.com
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] SPAM-LOW: Re: Re: Node.GetInfo error

2010-11-01 Thread arnaud.champion
?Hi,
I think the solution is in the last patches I have send (which are not yet in 
the git). Have you tried the NodeInfoStructure I have sended yesterday ?

Arnaud


From: 黄亮 
Sent: Monday, November 01, 2010 3:01 AM
To: arnaud.champ...@devatom.fr 
Cc: libvir-list 
Subject: SPAM-LOW: Re: Re: Node.GetInfo error


HI,

I tried 

Errors.Error err = Errors.GetLastError();
MessageBox.Show(err.Message);

But  IDE shows compilation errors that there is no "Error" defination in 
"Errors", and "Errors.GetLastError()" returns int.
I made a guess that maybe it was like this:

Error err = Errors.SaveLastError();
MessageBox.Show("Get Info error: " + err.Message);

It can be compiled but "err.Message" has nothing in it.

Did I make a wrong assumption?

Regards


2010-11-01 



Lancer 



发件人: arnaud.champ...@devatom.fr 
发送时间: 2010-10-31  16:48:15 
收件人: 黄亮 
抄送: libvir-list@redhat.com 
主题: Re: Node.GetInfo error 
Ok,

at first GetLastError return an Error object. So you should anything like :

Errors.Error err = Errors.GetLastError();
MessageBox.Show(err.Message);

For the NodeInfo structure, I think the problem is the same that was for 
DomainInfo, I'll check marshaling. Then respond you with the correct infos.

Arnaud

PS : can you also put libvirt-l...@redhat.com in copy of your mails, to keep 
everyone in the loop ?


From: 黄亮 
Sent: Sunday, October 31, 2010 8:20 AM
To: arnaud.champion 
Subject: Node.GetInfo error


Hi,

Sorry for disturbing again. But I get error while using Node.GetInfo.

Code:

NodeInfo aNodeInfo = new NodeInfo();
if (Node.GetInfo(con, aNodeInfo) < 0)
{
//MessageBox.Show("Node Info Error");
MessageBox.Show(Errors.GetLastError().ToString());
return 0f;
}

I'm sure con != IntPtr.Zero. I tried to use Errors.GetLastError(), it returns 
int. But I don't know what to do with it.
So, any suggestions ? Thanks 

Regards
2010-10-31 



Lancer 


__ Information from ESET Smart Security, version of virus signature 
database 5577 (20101030) __

The message was checked by ESET Smart Security.

http://www.eset.com
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Node.GetInfo error

2010-10-31 Thread arnaud.champion
?Okay, the NodeInfo structure must be marshled in this way to make it works :

/// 

/// Structure to handle node informations

/// 

[StructLayout(LayoutKind.Sequential)]

public class NodeInfo

{

/// 

/// String indicating the CPU model.

/// 

[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]

public string model;

/// 

/// Memory size in kilobytes

/// 

[MarshalAs(UnmanagedType.SysUInt)]

public UIntPtr memory;

/// 

/// The number of active CPUs.

/// 

[MarshalAs(UnmanagedType.SysUInt)]

public UIntPtr cpus;

/// 

/// Expected CPU frequency.

/// 

[MarshalAs(UnmanagedType.SysUInt)]

public UIntPtr mhz;

/// 

/// The number of NUMA cell, 1 for uniform mem access.

/// 

[MarshalAs(UnmanagedType.SysUInt)]

public UIntPtr nodes;

/// 

/// Number of CPU socket per node.

/// 

[MarshalAs(UnmanagedType.SysUInt)]

public UIntPtr sockets;

/// 

/// Number of core per socket.

/// 

[MarshalAs(UnmanagedType.SysUInt)]

public UIntPtr cores;

/// 

/// Number of threads per core.

/// 

[MarshalAs(UnmanagedType.SysUInt)]

public UIntPtr threads;

}



I will put it in next patches.



Cheers,



Arnaud



From: arnaud.champ...@devatom.fr 
Sent: Sunday, October 31, 2010 9:47 AM
To: 黄亮 
Cc: libvir-list@redhat.com 
Subject: Re: [libvirt] Node.GetInfo error


Ok,

at first GetLastError return an Error object. So you should anything like :

Errors.Error err = Errors.GetLastError();
MessageBox.Show(err.Message);

For the NodeInfo structure, I think the problem is the same that was for 
DomainInfo, I'll check marshaling. Then respond you with the correct infos.

Arnaud

PS : can you also put libvirt-l...@redhat.com in copy of your mails, to keep 
everyone in the loop ?


From: 黄亮 
Sent: Sunday, October 31, 2010 8:20 AM
To: arnaud.champion 
Subject: Node.GetInfo error


Hi,

Sorry for disturbing again. But I get error while using Node.GetInfo.

Code:

NodeInfo aNodeInfo = new NodeInfo();
if (Node.GetInfo(con, aNodeInfo) < 0)
{
//MessageBox.Show("Node Info Error");
MessageBox.Show(Errors.GetLastError().ToString());
return 0f;
}

I'm sure con != IntPtr.Zero. I tried to use Errors.GetLastError(), it returns 
int. But I don't know what to do with it.
So, any suggestions ? Thanks 

Regards
2010-10-31 



Lancer 





--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Node.GetInfo error

2010-10-31 Thread arnaud.champion
?Ok,

at first GetLastError return an Error object. So you should anything like :

Errors.Error err = Errors.GetLastError();
MessageBox.Show(err.Message);

For the NodeInfo structure, I think the problem is the same that was for 
DomainInfo, I'll check marshaling. Then respond you with the correct infos.

Arnaud

PS : can you also put libvirt-l...@redhat.com in copy of your mails, to keep 
everyone in the loop ?


From: 黄亮 
Sent: Sunday, October 31, 2010 8:20 AM
To: arnaud.champion 
Subject: Node.GetInfo error


Hi,

Sorry for disturbing again. But I get error while using Node.GetInfo.

Code:

NodeInfo aNodeInfo = new NodeInfo();
if (Node.GetInfo(con, aNodeInfo) < 0)
{
//MessageBox.Show("Node Info Error");
MessageBox.Show(Errors.GetLastError().ToString());
return 0f;
}

I'm sure con != IntPtr.Zero. I tried to use Errors.GetLastError(), it returns 
int. But I don't know what to do with it.
So, any suggestions ? Thanks 

Regards
2010-10-31 



Lancer --
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] SPAM-LOW: Domain.GetInfo error

2010-10-31 Thread arnaud.champion
?Hi,

In fact, when you compile libvirt with mingwin/msys, the binaries are compiled 
in 32 bits, even it runs on a 64 bits system. Accordingly, C# bindings must be 
targeted as x86 (32 bits) when compiling them. This isn't a problem for a 64 
bits application which use bindings, .Net make the trick to make it works.

I haven't made any test with xen (I haven't xen) but if your sample works, it 
means libvirt is compiled with xen support.

Happy halloween to you also.

Arnaud


From: 黄亮 
Sent: Sunday, October 31, 2010 6:52 AM
To: arnaud.champ...@devatom.fr 
Subject: Re: Re: SPAM-LOW: Domain.GetInfo error


Hi,

Thanks for your reply.
It works with the patch you provide in last letter.
But I don't understand "x86 target" you mentioned, does it mean if I want to 
make the code run, the server which runs xend & libvirtd must be a x86 arch, 
not a x64 arch?

As to the question "are you sure also that libvirt dll is compiled with xen 
support ?"
I just follow the instructions on http://github.com/photron/msys_setup, without 
the ESX support, I think it should support Xen, though it isn't write in 
explicit.

Anyway, at least it's working. Thanks for your reply.

Regards and Best wishes, and Happy Halloween XD


2010-10-31 



Lancer 



发件人: arnaud.champ...@devatom.fr 
发送时间: 2010-10-31  01:21:52 
收件人: 黄亮 
抄送: libvir-list@redhat.com 
主题: Re: SPAM-LOW: Domain.GetInfo error 
Hi,

So, at first, are you sure that conn != IntPtr.Zero and pDomain != IntPtr.Zero.
if both pointer are ok, can you please check the DomainInfo marshal, I have 
just sended patch today around this structure, and I think the patch is not yet 
pushed to the git.
The DomainInfo structure must be marshaled in this way :

/// 

/// Structure to handle domain informations

/// 

[StructLayout(LayoutKind.Sequential)]

public class DomainInfo

{

/// 

/// The running state, one of virDomainState.

/// 

private byte state;

/// 

/// The maximum memory in KBytes allowed.

/// 

[MarshalAs(UnmanagedType.SysUInt)]

public UIntPtr maxMem;

/// 

/// The memory in KBytes used by the domain.

/// 

[MarshalAs(UnmanagedType.SysUInt)]

public UIntPtr memory;

/// 

/// The number of virtual CPUs for the domain.

/// 

public ushort nrVirtCpu;

/// 

/// The CPU time used in nanoseconds.

/// 

[MarshalAs(UnmanagedType.SysUInt)]

public UIntPtr cpuTime;

/// 

/// The running state, one of virDomainState.

/// 

public DomainState State { get { return (DomainState)state; } }

}



Also, another important thing change : the libvirt bindings project must have 
an x86 target to make this marshaling working. This is also in the patch.



Another thing, you can also use Errors.GetLastErro() method to identify the 
problem, it return an error class which can inform you about the problem.



Best regards,



Arnaud



PS : are you sure also that libvirt dll is compiled with xen support ?



From: 黄亮 
Sent: Saturday, October 30, 2010 7:07 PM
To: arnaud.champion 
Subject: SPAM-LOW: Domain.GetInfo error


Dear Arnaud

Here is my test code. Function Domain.GetInfo return -1 and I don't know where 
is the mistake.
Would you do me a favor to point out the problem? Thank you!

Code:

   IntPtr conn = Connect.Open("xen+tcp://192.168.0.1?no_verify=1");
   String DomainName = e.Node.Text;
   IntPtr pDomain = Domain.LookupByName(conn, DomainName);

   DomainInfo aInfo = new DomainInfo();
   if (Domain.GetInfo(pDomain, aInfo) == -1)
   {
MessageBox.Show("Get Info error");
return;
   }

2010-10-31 



黄亮 


__ Information from ESET Smart Security, version of virus signature 
database 5576 (20101029) __

The message was checked by ESET Smart Security.

http://www.eset.com
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] SPAM-LOW: Domain.GetInfo error

2010-10-30 Thread arnaud.champion
?Hi,

So, at first, are you sure that conn != IntPtr.Zero and pDomain != IntPtr.Zero.
if both pointer are ok, can you please check the DomainInfo marshal, I have 
just sended patch today around this structure, and I think the patch is not yet 
pushed to the git.
The DomainInfo structure must be marshaled in this way :

/// 

/// Structure to handle domain informations

/// 

[StructLayout(LayoutKind.Sequential)]

public class DomainInfo

{

/// 

/// The running state, one of virDomainState.

/// 

private byte state;

/// 

/// The maximum memory in KBytes allowed.

/// 

[MarshalAs(UnmanagedType.SysUInt)]

public UIntPtr maxMem;

/// 

/// The memory in KBytes used by the domain.

/// 

[MarshalAs(UnmanagedType.SysUInt)]

public UIntPtr memory;

/// 

/// The number of virtual CPUs for the domain.

/// 

public ushort nrVirtCpu;

/// 

/// The CPU time used in nanoseconds.

/// 

[MarshalAs(UnmanagedType.SysUInt)]

public UIntPtr cpuTime;

/// 

/// The running state, one of virDomainState.

/// 

public DomainState State { get { return (DomainState)state; } }

}



Also, another important thing change : the libvirt bindings project must have 
an x86 target to make this marshaling working. This is also in the patch.



Another thing, you can also use Errors.GetLastErro() method to identify the 
problem, it return an error class which can inform you about the problem.



Best regards,



Arnaud



PS : are you sure also that libvirt dll is compiled with xen support ?



From: 黄亮 
Sent: Saturday, October 30, 2010 7:07 PM
To: arnaud.champion 
Subject: SPAM-LOW: Domain.GetInfo error


Dear Arnaud

Here is my test code. Function Domain.GetInfo return -1 and I don't know where 
is the mistake.
Would you do me a favor to point out the problem? Thank you!

Code:

   IntPtr conn = Connect.Open("xen+tcp://192.168.0.1?no_verify=1");
   String DomainName = e.Node.Text;
   IntPtr pDomain = Domain.LookupByName(conn, DomainName);

   DomainInfo aInfo = new DomainInfo();
   if (Domain.GetInfo(pDomain, aInfo) == -1)
   {
MessageBox.Show("Get Info error");
return;
   }

2010-10-31 



黄亮 --
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Hyper-V driver ?

2010-10-30 Thread arnaud.champion

?Interesting... You a Hyper-V user ;)

--
From: "Michael Sievers" 
Sent: Saturday, October 30, 2010 2:48 PM
To: 
Subject: Re: [libvirt] Hyper-V driver ?


Hi !

My name ist Michael Sievers. I am studying computer science at
Paderborn/Germany. I worked together with Matthias Bolte on a project
here at Paderborn, where we evaluated the possibility of controlling
Microsoft Hyper-V using WS-Management through libvirt (which is
actually called WinRM on Windows).

At the end of the project I had a very minimalistic libvirt driver,
which was just able to connect to Hyper-V and to power cycle a given
VM.

Unfortunately, the project stopped at this point and so did my efforts
on this topic.

Since developing a full fledged Hyper-V driver for libvirt a very time
consuming effort I am currently searching for a way to do so which
incorporates with my study.

At this point I can tell you the following

- it is possible to control Hyper-V using libvirt using WS-Management
- this is actually the only way (as far as I know) to control Hyper-V
from non-Windows hosts, as you can not use WMI (which is Hyper-V main
API) from non Windows hosts directly
- WS-Management is the bridge to talk to WMI from non-Windows hosts as
there are implementations such as OpenWSman which you can use
- doing complicated things in WS-Management (e.g. calling a function
with reference parameters) is not well documented and that's why a
pain to implement

The last point was the main reason, why the development stopped after
implementing the power cycling.

Last week I talked to my professor about this and he told me, that
maybe there is a company (unfortunately I can't tell you the name)
which is willing to support this effort financially, which would give
me to opportunity to resume development. But sadly this not for sure,
yet.

I will inform you (the libvirt mailing list) during the next two weeks
about the results.

Cheers

Michael Sievers

P.S.

Sorry for sending this mail three times to libvir-list as I did not
remembered that I once subscribed with a different email address.

2010/10/30 Justin Clift :

On 10/30/2010 03:21 AM, Daniel Veillard wrote:


"WS-Management Protocol" points to
http://msdn.microsoft.com/en-us/library/aa384470%28v=VS.85%29.aspx
where "Web Services for Management (WS–Management)." points to
http://www.dmtf.org/sites/default/files/standards/documents/DSP0226.pdf

 which says Page Not Found I find that lovely ...


Heh.  The link you probably want is this one:

 http://www.dmtf.org/standards/wsman

My understanding of the Web Services Management thing, is that it's not
a Microsoft initiative, but is instead a "vendor neutral" effort, and
somehow involves CIM.



Matthias went through the huge work of developping SOAP code to talk
to ESX, I wonder how much could be reused for the SOAP to talk to
this.

But it certainly requires someone dedicated for a long time, not sure
we will get someone who really needs this.


Kind of wondering if our existing CIM stuff might "just work" with it
already.  Not something I know anything about though. :)

 http://libvirt.org/CIM/   <-- not much info here. :/
 http://wiki.libvirt.org/page/Libvirt-cim_setup

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] virDomainInfo marshalling prolem

2010-10-30 Thread arnaud.champion

Hi,

I think I got it. I think I have to marshal in this manner :

[StructLayout(LayoutKind.Sequential)]
   public class DomainInfo
   {
   private byte state;
   [MarshalAs(UnmanagedType.SysUInt)]
   public UIntPtr maxMem;
   [MarshalAs(UnmanagedType.SysUInt)]
   public UIntPtr memory;
   public ushort nrVirtCpu;
   [MarshalAs(UnmanagedType.SysUInt)]
   public UIntPtr cpuTime;
   public DomainState State { get { return (DomainState)state; } }
   }

And I also have to set the target of the LibvirtBindings project to x86. Why 
? The compilation of libvirt under mingwin produce a 32bits binary, so I 
MUST marshal libvirt with a 32bits schema. That doesn't break compatibility 
with 64bits project using bindings, and this allow the usage of the 
attribute [MarshalAs(Unamanged.SysUint)]. This attribute specify the target 
schema for bindings at runtime. In this way, under 64bits systems, it takes 
ulong on 8 bytes, and on 4 bytes under 32bits.


This make the bindings work under Windows/mono(32bits, as the mono 
exxcutable is in 32bits, even if my system is 64bits), works also under 
Windows/.Net(64bits) and works under Ubuntu/Mono(64 bits).


Any suggestion ?

Regards,

Arnaud

--
From: "Justin Clift" 
Sent: Saturday, October 30, 2010 1:39 AM
To: 
Cc: "Matthias Bolte" ; "Daniel P. Berrange" 
; 

Subject: Re: [libvirt] virDomainInfo marshalling prolem


On 10/30/2010 01:48 AM, arnaud.champ...@devatom.fr wrote:

There is an unmanaged type to specify when marshaling this :
UnamanagedType.SysInt or UnmanagedType.SysUInt, which are 64b or 32bits
aware. But the problem under windows : libvirt is compiled thru mingwin
so the dll is in 32bits and even if windows is in 64bits, I have to make
bindings over 32bits (I'm not sure my english make things clear when I
explain)


Yeah, that's clear.  Using mingwin is causing the bindings to be 32-bit,
regardless of whether the Windows OS is 32-bit or 64-bit.



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Hyper-V driver ?

2010-10-29 Thread arnaud.champion
Hmm, I haven't the skill to do that, but I should be useful. Everyone who 
have seen the Microsoft tool that manage Hyper-V want another one :) My tool 
DAVIM can manage Hyper V, I use WMI, and WMI are managable via WinRM...


--
From: "Daniel Veillard" 
Sent: Friday, October 29, 2010 6:21 PM
To: 
Cc: 
Subject: Re: [libvirt] Hyper-V driver ?

On Fri, Oct 29, 2010 at 05:57:22PM +0200, arnaud.champ...@devatom.fr 
wrote:

?Hi,

I was just thinking about Hyper-V, has anyone ever tried to create a 
driver for Hyper-V via WinRM 
(http://msdn.microsoft.com/en-us/library/aa384426(VS.85).aspx)
I don't know if it is possible, and I have certainly not the skills to 
make one, but I think it can be a possibility no ?


 "WS-Management Protocol" points to
http://msdn.microsoft.com/en-us/library/aa384470%28v=VS.85%29.aspx
where "Web Services for Management (WS–Management)." points to
http://www.dmtf.org/sites/default/files/standards/documents/DSP0226.pdf

 which says Page Not Found
I find that lovely ...

Matthias went through the huge work of developping SOAP code to talk
to ESX, I wonder how much could be reused for the SOAP to talk to this.

But it certainly requires someone dedicated for a long time, not
sure we will get someone who really needs this.

Daniel

--
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] Hyper-V driver ?

2010-10-29 Thread arnaud.champion
?Hi,

I was just thinking about Hyper-V, has anyone ever tried to create a driver for 
Hyper-V via WinRM (http://msdn.microsoft.com/en-us/library/aa384426(VS.85).aspx)
I don't know if it is possible, and I have certainly not the skills to make 
one, but I think it can be a possibility no ?

Regards,

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH C#] Always close connections and free domains

2010-10-29 Thread arnaud.champion

Hmm, that's what I call a "wrapper" (I don't know if it is the good term)

I have created one for my project DAVIM.
It is almost complete, I have encapsulate IntPtr and all of this in classes.

for example I have class "LibvirtHost" and "LibvirtDomain" and 
"LibvirtNetwork" and so on.

Each object keep his IntPtr and expose smooth methods to use bindings.

I don't know if it can be a start point.

Arnaud

--
From: "Matthias Bolte" 
Sent: Friday, October 29, 2010 4:58 PM
To: 
Cc: ; 
Subject: Re: [libvirt] [PATCH C#] Always close connections and free domains


2010/10/28 Daniel Veillard :

On Thu, Oct 28, 2010 at 12:37:18PM +0200, Matthias Bolte wrote:

Also free the unmanaged authDataPtr in the virConnectOpenAuth
examples.


 I'm no C# expert by all mean ... so I'm not sure I should comment


Same here. I'm basically applied my C++ and Java knowledge onto C# and
see how far I come with that :)


[...]

 }
 string domainName = Domain.GetName(domainPtr);
+Domain.Free(domainPtr);


 but that I wonder ... When people are used to GC'ed languages, they
hate when they have to do the cleanup themselve and end up with leaks
left and right (from experience with libxml2 python bindings...)
 Is there really no way to do some kind of automatic garbage collection
of Domain objects, or is adding this just a way to speed up the GC in
a loop ?

 otherwise patch looks 'normal' to my unexercized eye :-)

Daniel


Currently the bindings are just a straightforward mapping for the C
API into C# using static methods and "void" pointers (actually
IntPtr). This basically works, but probably doesn't feel very C#'ish.

I think we might complete the bindings at this level. Once that basic
thin layer is done and all the hard problems are solved - like the
heap issue in the auth callback (has a workaround) or the integer
width on different platforms problem with the virDomainInfo struct -
then we can wrap this "first level" bindings into a more C#'ish way
with instances of the Domain class representing an underlying
virDomainPtr etc.

At that level we can use the GC and let it collect domain objects. But
we'll still keep the explicit Free() methods as in the Java bindings,
because I think that the C# GC - as most/all GC languages - doesn't
guarantee calling finalizers/destructors at all and we might end up
with leaked underlying objects. Maybe I'm wrong here, I'm not a C#
expert after all :)

Matthias 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] virDomainInfo marshalling prolem

2010-10-29 Thread arnaud.champion
There is an unmanaged type to specify when marshaling this : 
UnamanagedType.SysInt or UnmanagedType.SysUInt, which are 64b or 32bits 
aware. But the problem under windows : libvirt is compiled thru mingwin so 
the dll is in 32bits and even if windows is in 64bits, I have to make 
bindings over 32bits (I'm not sure my english make things clear when I 
explain)


Arnaud

--
From: 
Sent: Friday, October 29, 2010 4:41 PM
To: "Matthias Bolte" ; "Daniel P. Berrange" 


Cc: 
Subject: Re: [libvirt] virDomainInfo marshalling prolem


Mouarf, funny thing :)


--
From: "Matthias Bolte" 
Sent: Friday, October 29, 2010 4:36 PM
To: "Daniel P. Berrange" 
Cc: ; 
Subject: Re: [libvirt] virDomainInfo marshalling prolem


2010/10/29 Daniel P. Berrange :

On Fri, Oct 29, 2010 at 04:19:22PM +0200, Matthias Bolte wrote:

2010/10/29  :
> Hi,
>
> I am working on the marshaling of the virDomainInfo structure. I have
> marshalled it in this way :
>
>
> ///
>
> 
>
> /// Structure to handle domain informations
>
> /// 
>
> [
>
> StructLayout(LayoutKind.Sequential)]
>
> public class DomainInfo
>
> {
>
> /// 
> /// The running state, one of virDomainState.
> /// 
> private Byte state;
> /// 
> /// The maximum memory in KBytes allowed.
> /// 
> public int maxMem;
> /// 
> /// The memory in KBytes used by the domain.
> /// 
> public int memory;
> /// 
> /// The number of virtual CPUs for the domain.
> /// 
> public short nrVirtCpu;
> /// 
> /// The CPU time used in nanoseconds.
> /// 
> public long cpuTime;
> /// 
> /// The running state, one of virDomainState.
> /// 
> public DomainState State { get { return (DomainState)state; } }
>
> }
>
> It work fine in 32 bits, but not in 64 bits, it seems that packing in 
> 64

> bits is different so infos are not in order. Am I right ?
>

In the struct looks like this

struct _virDomainInfo {
unsigned char state;/* the running state, one of 
virDomainState */
unsigned long maxMem;   /* the maximum memory in KBytes allowed 
*/
unsigned long memory;   /* the memory in KBytes used by the 
domain */
unsigned short nrVirtCpu;   /* the number of virtual CPUs for the 
domain */

unsigned long long cpuTime; /* the CPU time used in nanoseconds */
};

but you mapped unsigned long to int. First of all you should map this
to an unsigned type. You also lost the unsigned for some other
members.

The problem probably is that long in C is 32bit on a 32bit platform an
64bit on a 64bit platform. You mapped it to int that is always 32bit
in C#, when I looked it up correctly.


Not quite. Windows just had to do things diffrently on 64-bit and so 
used

the LLP64 model instead of LP64 used by the rest of the world :-(

 http://technet.microsoft.com/en-us/library/bb496995.aspx

 In the UNIX/64 data model:
 The size of int is 32 bits and the size of long and pointers is 64 
bits.


 In the Win64 model:
 The size of int and long is 32 bits; the size of int64 (new type) 
and pointers is 64 bits.


Regards,
Daniel



Ah yes. I forgot about that one. So this gets even more complicated
when you want to get the C# bindings working on 32 and 64 bit Windows
and Linux.

Matthias



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH C#] Don't add a column per item in the Mono virConnectOpenAuth example

2010-10-29 Thread arnaud.champion

Okay,

For sure I am OK this patch make things cleaner, I have just a little 
problem : on windows, virConnectClose always failed.


--
From: "Matthias Bolte" 
Sent: Friday, October 29, 2010 4:43 PM
To: 
Cc: ; 
Subject: Re: [libvirt] [PATCH C#] Don't add a column per item in the Mono 
virConnectOpenAuth example



2010/10/29  :

?Hi,

I don't see the patches applied on git, normal ?

Arnaud


I just hadn't pushed it yet, because I was actually waiting for you to
have a look at it and give an ACK. because I'm a very unfamiliar with
C#.

I'm going to push this one now, because it's a simple patch that won't
break something.


--
From: "Daniel Veillard" 
Sent: Thursday, October 28, 2010 9:33 PM
To: "Matthias Bolte" 
Cc: 
Subject: Re: [libvirt] [PATCH C#] Don't add a column per item in the Mono
virConnectOpenAuth example


On Thu, Oct 28, 2010 at 12:38:51PM +0200, Matthias Bolte wrote:


---
 .../MonoDevelop/virConnectOpenAuth/MainWindow.cs   |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)


 ACK,

Daniel



Thanks, pushed.

Matthias



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] virDomainInfo marshalling prolem

2010-10-29 Thread arnaud.champion

Mouarf, funny thing :)


--
From: "Matthias Bolte" 
Sent: Friday, October 29, 2010 4:36 PM
To: "Daniel P. Berrange" 
Cc: ; 
Subject: Re: [libvirt] virDomainInfo marshalling prolem


2010/10/29 Daniel P. Berrange :

On Fri, Oct 29, 2010 at 04:19:22PM +0200, Matthias Bolte wrote:

2010/10/29  :
> Hi,
>
> I am working on the marshaling of the virDomainInfo structure. I have
> marshalled it in this way :
>
>
> ///
>
> 
>
> /// Structure to handle domain informations
>
> /// 
>
> [
>
> StructLayout(LayoutKind.Sequential)]
>
> public class DomainInfo
>
> {
>
> /// 
> /// The running state, one of virDomainState.
> /// 
> private Byte state;
> /// 
> /// The maximum memory in KBytes allowed.
> /// 
> public int maxMem;
> /// 
> /// The memory in KBytes used by the domain.
> /// 
> public int memory;
> /// 
> /// The number of virtual CPUs for the domain.
> /// 
> public short nrVirtCpu;
> /// 
> /// The CPU time used in nanoseconds.
> /// 
> public long cpuTime;
> /// 
> /// The running state, one of virDomainState.
> /// 
> public DomainState State { get { return (DomainState)state; } }
>
> }
>
> It work fine in 32 bits, but not in 64 bits, it seems that packing in 
> 64

> bits is different so infos are not in order. Am I right ?
>

In the struct looks like this

struct _virDomainInfo {
unsigned char state;/* the running state, one of 
virDomainState */
unsigned long maxMem;   /* the maximum memory in KBytes allowed 
*/
unsigned long memory;   /* the memory in KBytes used by the 
domain */
unsigned short nrVirtCpu;   /* the number of virtual CPUs for the 
domain */

unsigned long long cpuTime; /* the CPU time used in nanoseconds */
};

but you mapped unsigned long to int. First of all you should map this
to an unsigned type. You also lost the unsigned for some other
members.

The problem probably is that long in C is 32bit on a 32bit platform an
64bit on a 64bit platform. You mapped it to int that is always 32bit
in C#, when I looked it up correctly.


Not quite. Windows just had to do things diffrently on 64-bit and so used
the LLP64 model instead of LP64 used by the rest of the world :-(

 http://technet.microsoft.com/en-us/library/bb496995.aspx

 In the UNIX/64 data model:
 The size of int is 32 bits and the size of long and pointers is 64 
bits.


 In the Win64 model:
 The size of int and long is 32 bits; the size of int64 (new type) 
and pointers is 64 bits.


Regards,
Daniel



Ah yes. I forgot about that one. So this gets even more complicated
when you want to get the C# bindings working on 32 and 64 bit Windows
and Linux.

Matthias



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] virDomainInfo marshalling prolem

2010-10-29 Thread arnaud.champion

Okay,

I have corrected to this structure :

public class DomainInfo
   {
   /// 
   /// The running state, one of virDomainState.
   /// 
   private byte state;
   /// 
   /// The maximum memory in KBytes allowed.
   /// 
   public ulong maxMem;
   /// 
   /// The memory in KBytes used by the domain.
   /// 
   public ulong memory;
   /// 
   /// The number of virtual CPUs for the domain.
   /// 
   public ushort nrVirtCpu;
   /// 
   /// The CPU time used in nanoseconds.
   /// 
   public ulong cpuTime;
   /// 
   /// The running state, one of virDomainState.
   /// 
   public DomainState State { get { return (DomainState)state; } }
   }

And now it works in 64bits but not in 32bits :S

Arnaud

--
From: "Matthias Bolte" 
Sent: Friday, October 29, 2010 4:19 PM
To: 
Cc: 
Subject: Re: [libvirt] virDomainInfo marshalling prolem


2010/10/29  :

Hi,

I am working on the marshaling of the virDomainInfo structure. I have
marshalled it in this way :


///



/// Structure to handle domain informations

/// 

[

StructLayout(LayoutKind.Sequential)]

public class DomainInfo

{

/// 
/// The running state, one of virDomainState.
/// 
private Byte state;
/// 
/// The maximum memory in KBytes allowed.
/// 
public int maxMem;
/// 
/// The memory in KBytes used by the domain.
/// 
public int memory;
/// 
/// The number of virtual CPUs for the domain.
/// 
public short nrVirtCpu;
/// 
/// The CPU time used in nanoseconds.
/// 
public long cpuTime;
/// 
/// The running state, one of virDomainState.
/// 
public DomainState State { get { return (DomainState)state; } }

}

It work fine in 32 bits, but not in 64 bits, it seems that packing in 64
bits is different so infos are not in order. Am I right ?



In the struct looks like this

struct _virDomainInfo {
   unsigned char state;/* the running state, one of virDomainState 
*/

   unsigned long maxMem;   /* the maximum memory in KBytes allowed */
   unsigned long memory;   /* the memory in KBytes used by the domain 
*/
   unsigned short nrVirtCpu;   /* the number of virtual CPUs for the 
domain */

   unsigned long long cpuTime; /* the CPU time used in nanoseconds */
};

but you mapped unsigned long to int. First of all you should map this
to an unsigned type. You also lost the unsigned for some other
members.

The problem probably is that long in C is 32bit on a 32bit platform an
64bit on a 64bit platform. You mapped it to int that is always 32bit
in C#, when I looked it up correctly.

Matthias 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] virDomainInfo marshalling prolem

2010-10-29 Thread arnaud.champion
?Hi,

I am working on the marshaling of the virDomainInfo structure. I have 
marshalled it in this way :

/// 

/// Structure to handle domain informations

/// 

[StructLayout(LayoutKind.Sequential)]

public class DomainInfo

{

/// 

/// The running state, one of virDomainState.

/// 

private Byte state;

/// 

/// The maximum memory in KBytes allowed.

/// 

public int maxMem;

/// 

/// The memory in KBytes used by the domain.

/// 

public int memory;

/// 

/// The number of virtual CPUs for the domain.

/// 

public short nrVirtCpu;

/// 

/// The CPU time used in nanoseconds.

/// 

public long cpuTime;

/// 

/// The running state, one of virDomainState.

/// 

public DomainState State { get { return (DomainState)state; } }

}

It work fine in 32 bits, but not in 64 bits, it seems that packing in 64 bits 
is different so infos are not in order. Am I right ?

Regards,



Arnaud
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] C# bindings raising an error

2010-10-29 Thread arnaud.champion

Perfect ! go for the 2nd one.

Arnaud

--
From: "Matthias Bolte" 
Sent: Friday, October 29, 2010 10:35 AM
To: 
Cc: "Justin Clift" ; 
Subject: Re: [libvirt] C# bindings raising an error


You can use the global virSetErrorFunc and try to open a connection to
a non-existing server.

Or open a connection to an existing server but try to call
virDomainLookupByName for a non-existing domain name to demonstrate
the use of virConnectSetErrorFunc.

Matthias

2010/10/29  :
?I'm not sure, because I want to show usage of virConnectSetErrorFunc 
which

take a valid connection pointer.

Arnaud

--
From: "Justin Clift" 
Sent: Friday, October 29, 2010 10:05 AM
To: 
Cc: 
Subject: Re: [libvirt] C# bindings raising an error


On 10/29/2010 06:57 PM, arnaud.champ...@devatom.fr wrote:


?Hi,

I start to work on a new sample code for C# bindings. The goal is to
show how to use errors callbacks... Do you a way to raise an error
for sample ? (I know it's an antagonist request  )


Maybe try to connect to a domain that doesn't exist?

 qemu+ssh://r...@mistake.example.org/system




--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list





--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] C# bindings raising an error

2010-10-29 Thread arnaud.champion
?Maybe I found a way : open a read only connection and make a thing which 
need a normal connection ?


--
From: 
Sent: Friday, October 29, 2010 10:12 AM
To: "Justin Clift" 
Cc: 
Subject: Re: [libvirt] C# bindings raising an error

?I'm not sure, because I want to show usage of virConnectSetErrorFunc 
which take a valid connection pointer.


Arnaud

--
From: "Justin Clift" 
Sent: Friday, October 29, 2010 10:05 AM
To: 
Cc: 
Subject: Re: [libvirt] C# bindings raising an error


On 10/29/2010 06:57 PM, arnaud.champ...@devatom.fr wrote:

?Hi,

I start to work on a new sample code for C# bindings. The goal is to
show how to use errors callbacks... Do you a way to raise an error
for sample ? (I know it's an antagonist request  )


Maybe try to connect to a domain that doesn't exist?

 qemu+ssh://r...@mistake.example.org/system




--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] SPAM-LOW: Re: Re: System.DllNotFoundException

2010-10-29 Thread arnaud.champion
?You're welcome, glad to help you.

Arnaud


From: 黄亮 
Sent: Friday, October 29, 2010 10:07 AM
To: arnaud.champ...@devatom.fr 
Subject: SPAM-LOW: Re: Re: System.DllNotFoundException


Hi,

depends.exe really helps!
it turns out that there are 7 dlls I'm missing. Thanks to the dll-files.com, I 
can download all of them.
And put all of them in the same dir with my test exe, it works.

Thank you arnaud, you really help a lot.

Best wishes


2010-10-29 



Lancer




发件人: arnaud.champ...@devatom.fr 
发送时间: 2010-10-29  15:38:47 
收件人: 黄亮 
抄送: libvir-list@redhat.com 
主题: Re: System.DllNotFoundException 
Hi,

what do you mean when you say "I use the .cs file you release to create a dll 
project" ?
C# bindings are provided with a visual studio 2010 solution, I think it's 
better to use it if you can. If you can't (because you have vs2005 or vs2008), 
please re-create a solution with all C# bindings codes.

Be sure you have the dll in your Debug directory :
libcurl-4.dll
libgcrypt-11.dll
libgnutls-26.dll
libgpg-error-0.dll
libportablexdr-0.dll
libtasn1-3.dll
libvirt-0.dll
libxml2-2.dll

Also, be carefull about one thing : these dll must be in the directory of the 
executable. I mean if you create a project "testBinding" which produce 
"testBindings.exe", then these dlls must be in the same directory of 
"testBindings.exe".

You can also use "depends.exe" (http://www.dependencywalker.com/) which is a 
tool used to check dll dependency. You open your libvirt-0.dll with it and see 
if there is no missing dll (maybe a dll miss you, and I don't see it because my 
system ever own it, I don't know).

Arnaud



From: 黄亮 
Sent: Friday, October 29, 2010 3:51 AM
To: arnaud.champ...@devatom.fr 
Subject: System.DllNotFoundException


Hello Arnaud

I've compiled libvirt using photron scripts and got the libvirt-0.dll
I use the .cs file you released to create a dll project, and get CSharpDll.dll
Then I create a new project to invoke CSharpDll.dll, I got a 
System.DllNotFoundException while "Libvirt.Connect.Open" is trying to work.
The exception shows libvirt-0.dll cannot be found.
I tried to put libvirt-0.dll everywhere. In the same dir with .sln, with .cs 
file, in Debug dir, even in Windows/System32 dir. But I got no luck. It's still 
stuck.

So I need your help to get me out of the mess. Would you please tell me where I 
may go wrong?
Many Thanks

2010-10-29 



Lancer 


__ Information from ESET Smart Security, version of virus signature 
database 5573 (20101028) __

The message was checked by ESET Smart Security.

http://www.eset.com
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] C# bindings raising an error

2010-10-29 Thread arnaud.champion
?I'm not sure, because I want to show usage of virConnectSetErrorFunc which 
take a valid connection pointer.


Arnaud

--
From: "Justin Clift" 
Sent: Friday, October 29, 2010 10:05 AM
To: 
Cc: 
Subject: Re: [libvirt] C# bindings raising an error


On 10/29/2010 06:57 PM, arnaud.champ...@devatom.fr wrote:

?Hi,

I start to work on a new sample code for C# bindings. The goal is to
show how to use errors callbacks... Do you a way to raise an error
for sample ? (I know it's an antagonist request  )


Maybe try to connect to a domain that doesn't exist?

 qemu+ssh://r...@mistake.example.org/system




--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] C# bindings raising an error

2010-10-29 Thread arnaud.champion
?Hi,

I start to work on a new sample code for C# bindings. The goal is to show how 
to use errors callbacks... Do you a way to raise an error for sample ? (I know 
it's an antagonist request  )

Regards,

Arnaud<>--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH C#] Don't add a column per item in the Mono virConnectOpenAuth example

2010-10-29 Thread arnaud.champion

?Hi,

I don't see the patches applied on git, normal ?

Arnaud

--
From: "Daniel Veillard" 
Sent: Thursday, October 28, 2010 9:33 PM
To: "Matthias Bolte" 
Cc: 
Subject: Re: [libvirt] [PATCH C#] Don't add a column per item in the Mono 
virConnectOpenAuth example



On Thu, Oct 28, 2010 at 12:38:51PM +0200, Matthias Bolte wrote:

---
 .../MonoDevelop/virConnectOpenAuth/MainWindow.cs   |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)


 ACK,

Daniel

--
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] System.DllNotFoundException

2010-10-29 Thread arnaud.champion
?Hi,

what do you mean when you say "I use the .cs file you release to create a dll 
project" ?
C# bindings are provided with a visual studio 2010 solution, I think it's 
better to use it if you can. If you can't (because you have vs2005 or vs2008), 
please re-create a solution with all C# bindings codes.

Be sure you have the dll in your Debug directory :
libcurl-4.dll
libgcrypt-11.dll
libgnutls-26.dll
libgpg-error-0.dll
libportablexdr-0.dll
libtasn1-3.dll
libvirt-0.dll
libxml2-2.dll

Also, be carefull about one thing : these dll must be in the directory of the 
executable. I mean if you create a project "testBinding" which produce 
"testBindings.exe", then these dlls must be in the same directory of 
"testBindings.exe".

You can also use "depends.exe" (http://www.dependencywalker.com/) which is a 
tool used to check dll dependency. You open your libvirt-0.dll with it and see 
if there is no missing dll (maybe a dll miss you, and I don't see it because my 
system ever own it, I don't know).

Arnaud



From: 黄亮 
Sent: Friday, October 29, 2010 3:51 AM
To: arnaud.champ...@devatom.fr 
Subject: System.DllNotFoundException


Hello Arnaud

I've compiled libvirt using photron scripts and got the libvirt-0.dll
I use the .cs file you released to create a dll project, and get CSharpDll.dll
Then I create a new project to invoke CSharpDll.dll, I got a 
System.DllNotFoundException while "Libvirt.Connect.Open" is trying to work.
The exception shows libvirt-0.dll cannot be found.
I tried to put libvirt-0.dll everywhere. In the same dir with .sln, with .cs 
file, in Debug dir, even in Windows/System32 dir. But I got no luck. It's still 
stuck.

So I need your help to get me out of the mess. Would you please tell me where I 
may go wrong?
Many Thanks

2010-10-29 



Lancer --
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH C#] Fix two memory leaks in the ConnectCredential.Result setter

2010-10-29 Thread arnaud.champion

?Hi,

this code is only for the bindings, not the client code. I try to find a 
solution since times now, but I haven't find an acceptable one for now. I 
keep searching anyway.


Arnaud

--
From: "Daniel Veillard" 
Sent: Thursday, October 28, 2010 9:32 PM
To: "Matthias Bolte" 
Cc: 
Subject: Re: [libvirt] [PATCH C#] Fix two memory leaks in the 
ConnectCredential.Result setter



On Thu, Oct 28, 2010 at 12:38:17PM +0200, Matthias Bolte wrote:

StringToHGlobalAnsi returns a pointer to unmanaged memory that
must be freed using FreeHGlobal.

When the setter is called twice the strdup'ed unmanaged string
from the first call leaks. Free it before assigning it again.

[...]

+
+// TODO : this is a temporary workaround for virConnectOpenAuth 
callback, this should be removed
+[DllImport("msvcrt.dll", EntryPoint = "free", CallingConvention 
= CallingConvention.Cdecl)]

+public static extern void Free(IntPtr ptr);
 }

[...]

+IntPtr tmp = Marshal.StringToHGlobalAnsi(value);
+
+NativeFunctions.Free(result);
+result = NativeFunctions.StrDup(tmp);
 resultlen = (uint)value.Length;
+
+Marshal.FreeHGlobal(tmp);


 This raises 2 questions, how temporary is 'temporary' ;-) ?
And I assume the client code don't need to do similar things, that's
just the bindings, right ?

Daniel

--
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] SPAM-LOW: Re: Re: Guide for libvirt C# bindings

2010-10-28 Thread arnaud.champion
?Yes all the dlls will be produced by this script.
In fact, thanks for the script to it's author, it's the harder part (especially 
for windows users as I am, we are not used to compile in the linux wa  )
I hope in the future that the libvirt windows dll will be directly hosted on 
libvirt.org, but I don't know.

Regards,

Arnaud


From: 黄亮 
Sent: Thursday, October 28, 2010 10:05 AM
To: arnaud.champ...@devatom.fr 
Subject: Re: Re: SPAM-LOW: Re: Re: Guide for libvirt C# bindings


Really appreciated!

Just to confirm that, all the dlls you mentioned is produced after I use 
photron scripts, right?
That's great. And really thank you for what you've done.

Regards and best wishes


2010-10-28 



黄亮 



发件人: arnaud.champ...@devatom.fr 
发送时间: 2010-10-28  15:45:15 
收件人: 黄亮 
抄送: libvir-list@redhat.com 
主题: Re: SPAM-LOW: Re: Re: Guide for libvirt C# bindings 
Okay,

libvirt-0.dll is the libvirt project compilation under windows. To produced it, 
there is two ways, the hard way and the smooth way 
the hard way is to install msys, mingwin and so one to have all needed tools, 
then download needed sources compile them. It's hard, and long.
the smooth way is to use photron (Matthias) scripts to produce it. You can find 
scripts here : http://github.com/photron/msys_setup
You download the scripts and foolow the readme.txt which is inside.

Once you have compiled libvirt, you need to put these dll in an accessible way 
for your application (usually, I put it under the .exe produced by .Net) :
- libcurl-4.dll (if compiled with esx support)
- libgcrypt-11.dll
- libgnutls-26.dll
- libgpg-error-0.dll
- libportablexdr-0.dll
- libtasn1-3.dll
- libvirt-0.dll
- libxml2-2.dll

Regards,

Arnaud



From: 黄亮 
Sent: Thursday, October 28, 2010 9:29 AM
To: arnaud.champ...@devatom.fr 
Subject: SPAM-LOW: Re: Re: Guide for libvirt C# bindings


Thank you for your reply.

I've downloaded the source code by git. It seems the project needs a dll called 
libvirt-0.dll.
It would be appreciated that you can tell me where to get the dll or how to 
produce it. Then I can try your examples and write my own.

Regards


2010-10-28 



Lancer 



发件人: arnaud.champ...@devatom.fr 
发送时间: 2010-10-28  15:12:43 
收件人: 黄亮 
抄送: libvir-list@redhat.com 
主题: Re: Guide for libvirt C# bindings 
Hi,

the C# bindings provides 3 sample code to show how to use them. All functions 
are not in the examples, but examples show how to connect and get domain events 
(callbacks...)

I use these bindings for another project : DAVIM ( www.devatom.fr sorry it's in 
french only ) and they work well.

Anyway, I can help you if you have questions.

Arnaud


From: 黄亮 
Sent: Thursday, October 28, 2010 4:30 AM
To: arnaud.champion 
Subject: Guide for libvirt C# bindings


Dear Arnaud Champion

I learned you are making C# bindings for libvirt on libvirt.org. I'm interested 
in it and want to have a try on Windows.
Do you have any guide books or introductions for using your C# bindings? I'm 
using .Net Framework 3.5 and VS 2005.

Look forward to your reply.
Regards


2010-10-28 



Lancer 


__ Information from ESET Smart Security, version of virus signature 
database 5569 (20101027) __

The message was checked by ESET Smart Security.

http://www.eset.com
<><>--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] SPAM-LOW: Re: Re: Guide for libvirt C# bindings

2010-10-28 Thread arnaud.champion

?Good idea :)

--
From: "Justin Clift" 
Sent: Thursday, October 28, 2010 10:33 AM
To: 
Cc: 
Subject: Re: [libvirt] SPAM-LOW:  Re: Re: Guide for libvirt C# bindings


We should probably cut-n-paste this onto the libvirt "Windows" page. :)

Matthias, any objections, or other bits we should include as well?

+ Justin

On 10/28/2010 06:44 PM, arnaud.champ...@devatom.fr wrote:

?Okay,

libvirt-0.dll is the libvirt project compilation under windows. To 
produced it, there is two ways, the hard way and the smooth way
the hard way is to install msys, mingwin and so one to have all needed 
tools, then download needed sources compile them. It's hard, and long.
the smooth way is to use photron (Matthias) scripts to produce it. You 
can find scripts here : http://github.com/photron/msys_setup

You download the scripts and foolow the readme.txt which is inside.

Once you have compiled libvirt, you need to put these dll in an 
accessible way for your application (usually, I put it under the .exe 
produced by .Net) :

- libcurl-4.dll (if compiled with esx support)
- libgcrypt-11.dll
- libgnutls-26.dll
- libgpg-error-0.dll
- libportablexdr-0.dll
- libtasn1-3.dll
- libvirt-0.dll
- libxml2-2.dll

Regards,

Arnaud





--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] SPAM-LOW: Re: Re: Guide for libvirt C# bindings

2010-10-28 Thread arnaud.champion
?In fact, I think it's better to let the choice to the libvirt team. I think 
they should have a good reason to not expose windows binary.

Regards

Arnaud


From: 黄亮 
Sent: Thursday, October 28, 2010 10:28 AM
To: arnaud.champ...@devatom.fr 
Subject: Re: Re: Re: SPAM-LOW: Re: Re: Guide for libvirt C# bindings


yes. Compiling them can be really tough. And thanks for your job that we may 
invoke api of libvirt in Windows. 
Maybe you can upload the dll somewhere if libvirt.org won't host, just a 
suggestion.

Regards.


2010-10-28 



Lancer




发件人: arnaud.champ...@devatom.fr 
发送时间: 2010-10-28  16:10:54 
收件人: 黄亮 
抄送: libvir-list@redhat.com 
主题: Re: Re: SPAM-LOW: Re: Re: Guide for libvirt C# bindings 
Yes all the dlls will be produced by this script.
In fact, thanks for the script to it's author, it's the harder part (especially 
for windows users as I am, we are not used to compile in the linux wa  )
I hope in the future that the libvirt windows dll will be directly hosted on 
libvirt.org, but I don't know.

Regards,

Arnaud


From: 黄亮 
Sent: Thursday, October 28, 2010 10:05 AM
To: arnaud.champ...@devatom.fr 
Subject: Re: Re: SPAM-LOW: Re: Re: Guide for libvirt C# bindings


Really appreciated!

Just to confirm that, all the dlls you mentioned is produced after I use 
photron scripts, right?
That's great. And really thank you for what you've done.

Regards and best wishes


2010-10-28 



黄亮 



发件人: arnaud.champ...@devatom.fr 
发送时间: 2010-10-28  15:45:15 
收件人: 黄亮 
抄送: libvir-list@redhat.com 
主题: Re: SPAM-LOW: Re: Re: Guide for libvirt C# bindings 
Okay,

libvirt-0.dll is the libvirt project compilation under windows. To produced it, 
there is two ways, the hard way and the smooth way 
the hard way is to install msys, mingwin and so one to have all needed tools, 
then download needed sources compile them. It's hard, and long.
the smooth way is to use photron (Matthias) scripts to produce it. You can find 
scripts here : http://github.com/photron/msys_setup
You download the scripts and foolow the readme.txt which is inside.

Once you have compiled libvirt, you need to put these dll in an accessible way 
for your application (usually, I put it under the .exe produced by .Net) :
- libcurl-4.dll (if compiled with esx support)
- libgcrypt-11.dll
- libgnutls-26.dll
- libgpg-error-0.dll
- libportablexdr-0.dll
- libtasn1-3.dll
- libvirt-0.dll
- libxml2-2.dll

Regards,

Arnaud



From: 黄亮 
Sent: Thursday, October 28, 2010 9:29 AM
To: arnaud.champ...@devatom.fr 
Subject: SPAM-LOW: Re: Re: Guide for libvirt C# bindings


Thank you for your reply.

I've downloaded the source code by git. It seems the project needs a dll called 
libvirt-0.dll.
It would be appreciated that you can tell me where to get the dll or how to 
produce it. Then I can try your examples and write my own.

Regards


2010-10-28 



Lancer 



发件人: arnaud.champ...@devatom.fr 
发送时间: 2010-10-28  15:12:43 
收件人: 黄亮 
抄送: libvir-list@redhat.com 
主题: Re: Guide for libvirt C# bindings 
Hi,

the C# bindings provides 3 sample code to show how to use them. All functions 
are not in the examples, but examples show how to connect and get domain events 
(callbacks...)

I use these bindings for another project : DAVIM ( www.devatom.fr sorry it's in 
french only ) and they work well.

Anyway, I can help you if you have questions.

Arnaud


From: 黄亮 
Sent: Thursday, October 28, 2010 4:30 AM
To: arnaud.champion 
Subject: Guide for libvirt C# bindings


Dear Arnaud Champion

I learned you are making C# bindings for libvirt on libvirt.org. I'm interested 
in it and want to have a try on Windows.
Do you have any guide books or introductions for using your C# bindings? I'm 
using .Net Framework 3.5 and VS 2005.

Look forward to your reply.
Regards


2010-10-28 



Lancer 


__ Information from ESET Smart Security, version of virus signature 
database 5569 (20101027) __

The message was checked by ESET Smart Security.

http://www.eset.com



__ Information from ESET Smart Security, version of virus signature 
database 5569 (20101027) __

The message was checked by ESET Smart Security.

http://www.eset.com
<<14.gif>><><>--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] SPAM-LOW: Re: Re: Guide for libvirt C# bindings

2010-10-28 Thread arnaud.champion
?Okay,

libvirt-0.dll is the libvirt project compilation under windows. To produced it, 
there is two ways, the hard way and the smooth way 
the hard way is to install msys, mingwin and so one to have all needed tools, 
then download needed sources compile them. It's hard, and long.
the smooth way is to use photron (Matthias) scripts to produce it. You can find 
scripts here : http://github.com/photron/msys_setup
You download the scripts and foolow the readme.txt which is inside.

Once you have compiled libvirt, you need to put these dll in an accessible way 
for your application (usually, I put it under the .exe produced by .Net) :
- libcurl-4.dll (if compiled with esx support)
- libgcrypt-11.dll
- libgnutls-26.dll
- libgpg-error-0.dll
- libportablexdr-0.dll
- libtasn1-3.dll
- libvirt-0.dll
- libxml2-2.dll

Regards,

Arnaud



From: 黄亮 
Sent: Thursday, October 28, 2010 9:29 AM
To: arnaud.champ...@devatom.fr 
Subject: SPAM-LOW: Re: Re: Guide for libvirt C# bindings


Thank you for your reply.

I've downloaded the source code by git. It seems the project needs a dll called 
libvirt-0.dll.
It would be appreciated that you can tell me where to get the dll or how to 
produce it. Then I can try your examples and write my own.

Regards


2010-10-28 



Lancer 



发件人: arnaud.champ...@devatom.fr 
发送时间: 2010-10-28  15:12:43 
收件人: 黄亮 
抄送: libvir-list@redhat.com 
主题: Re: Guide for libvirt C# bindings 
Hi,

the C# bindings provides 3 sample code to show how to use them. All functions 
are not in the examples, but examples show how to connect and get domain events 
(callbacks...)

I use these bindings for another project : DAVIM ( www.devatom.fr sorry it's in 
french only ) and they work well.

Anyway, I can help you if you have questions.

Arnaud


From: 黄亮 
Sent: Thursday, October 28, 2010 4:30 AM
To: arnaud.champion 
Subject: Guide for libvirt C# bindings


Dear Arnaud Champion

I learned you are making C# bindings for libvirt on libvirt.org. I'm interested 
in it and want to have a try on Windows.
Do you have any guide books or introductions for using your C# bindings? I'm 
using .Net Framework 3.5 and VS 2005.

Look forward to your reply.
Regards


2010-10-28 



Lancer 


__ Information from ESET Smart Security, version of virus signature 
database 5569 (20101027) __

The message was checked by ESET Smart Security.

http://www.eset.com
<>--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] C# bindins web page changes

2010-10-28 Thread arnaud.champion

?Yes it's perfect. The dll name is still LibvirtBindings.dll.

Just a little error : "plus many classes exposng the libvirt API", the "i" 
miss...


Regards,

Arnaud

--
From: "Justin Clift" 
Sent: Thursday, October 28, 2010 9:36 AM
To: 
Cc: 
Subject: Re: C# bindins web page changes


On 10/28/2010 08:22 AM, arnaud.champ...@devatom.fr wrote:

?Hi Justin,

since renaming of the C# bindings is done, the usage described has
also to be changed.

I'll try to explain you :

the project no more expose the namespace "libvirtBindings", in place
the new namespace is "Libvirt".


Ok.  Is this updated version correct?

 http://justinclift.fedorapeople.org/csharp/csharp.html#usage

Also, is the name of the .dll file still "LibvirtBindings.dll"?

The "Test Configuration" part has also been changed on that page.  The
tables have been converted from your .xls file too.

Let me know what needs to be changed, or if we can update the main
libvirt.org site with the new page. :)

Regards and best wishes,

Justin Clift



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Guide for libvirt C# bindings

2010-10-28 Thread arnaud.champion
?Hi,

the C# bindings provides 3 sample code to show how to use them. All functions 
are not in the examples, but examples show how to connect and get domain events 
(callbacks...)

I use these bindings for another project : DAVIM ( www.devatom.fr sorry it's in 
french only ) and they work well.

Anyway, I can help you if you have questions.

Arnaud


From: 黄亮 
Sent: Thursday, October 28, 2010 4:30 AM
To: arnaud.champion 
Subject: Guide for libvirt C# bindings


Dear Arnaud Champion

I learned you are making C# bindings for libvirt on libvirt.org. I'm interested 
in it and want to have a try on Windows.
Do you have any guide books or introductions for using your C# bindings? I'm 
using .Net Framework 3.5 and VS 2005.

Look forward to your reply.
Regards


2010-10-28 



Lancer --
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] libvirt-csharp coverage update

2010-10-28 Thread arnaud.champion

Hi,

for me yes, it's a good idea. I think it's quite usable, mostof functions 
are binded and examples works well.


Arnaud

--
From: "Justin Clift" 
Sent: Thursday, October 28, 2010 12:16 AM
To: "Matthias Bolte" ; 


Cc: 
Subject: Re: [libvirt] libvirt-csharp coverage update


On 10/28/2010 07:07 AM, Matthias Bolte wrote:

Okay, Daniel fixed the problem and I've pushed your patches now.

Matthias


Hey guys,

Are these C# bindings in a good state for us to make a tarball with?

 i.e.  libvirt-csharp-0.1.0.tar.bz2

(Yeah, I know I need to update the web page today too. :> )








--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] C# bindins web page changes

2010-10-27 Thread arnaud.champion
?Hi Justin,

since renaming of the C# bindings is done, the usage described has also to be 
changed.

I'll try to explain you :

the project no more expose the namespace "libvirtBindings", in place the new 
namespace is "Libvirt".

The Libvirt namespace expose all types needed (struct, enum...)

Now there is more classes to expose API methods :
- virConnect... methods (virConnectOpen, virConnectNumOfDomains,etc) are in the 
"Connect" class. For example, "virConnectOpenAuth" is "Connect.OpenAuth" method 
in bindings, "virConnectNumOfDomains" is "Connect.NumOfDomains"

In the same manner :
virDomain... methods are in the "Domain" class
virEvent... in the "Event" class
virInterface... in the "Interface" class
virNetwork... in the "Network" class
virNode... in the "Node" class
virSecret... in the "Secret" class (even if nothing is binded in it :S but it 
will be)
virStoragePool... in the "StoragePool" class
virStorageVolume... in the "StorageVolume" class
virStream... in the "Stream" class

There is some exceptions in fact :
 - there is a class "Library" which expose "virGetVersion" and "virInitialize" 
methods
 - the class "Errors" which expose error related methods (for example 
"virSetErrorFunc" or "virConnResetLastError")

Best regards,

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] libvirt-csharp coverage update

2010-10-27 Thread arnaud.champion

yep, no problem ;)

Arnaud

--
From: "Matthias Bolte" 
Sent: Wednesday, October 27, 2010 9:51 PM
To: 
Cc: "Justin Clift" ; 
Subject: Re: [libvirt] libvirt-csharp coverage update


2010/10/27  :

Hi Justin,

I have sended some patches today. When they will be pushed the coverage 
will

the one in the xls file.


I was about to push them and already responded to your mails saying
that I pushed them, but there seems to be a problem on the server
hosting libvirt.org that doesn't let me push to libvirt-csharp.git.
Once that's fixed (probably tomorrow, I hope) I'll really push them.

Matthias



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] Gtk# help

2010-10-27 Thread arnaud.champion
?Hi,

As you maybe have seen in my csharp sample code, I'm not an expert with Gtk# 
under mono, it's really different from windows form. Can anyone help me with 
Gtk# to make the bindings samples better ?

Arnaud--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [libvirt-csharp][PATCH] Make examples works on monocompiled in 64 bits, simply the ConnectOpenAuth process, and finalise renaming

2010-10-27 Thread arnaud.champion
?Oops again, a little mistake again :S

In mono, we can't loop thru ref array objects.

Sorry

Arnaud


From: arnaud.champ...@devatom.fr 
Sent: Wednesday, October 27, 2010 2:05 PM
To: arnaud.champ...@devatom.fr ; libvir-list@redhat.com 
Subject: Re: [libvirt] [libvirt-csharp][PATCH] Make examples works on 
monocompiled in 64 bits, simply the ConnectOpenAuth process,and finalise 
renaming


Oops, I have made a little mistake that make the example not compiling. This 
patch make it works, sorry :S


From: arnaud.champ...@devatom.fr 
Sent: Wednesday, October 27, 2010 1:50 PM
To: libvir-list@redhat.com 
Subject: [libvirt] [libvirt-csharp][PATCH] Make examples works on monocompiled 
in 64 bits, simply the ConnectOpenAuth process,and finalise renaming


Hi,

I have finally find the problem with examples on mono compiled in 64 bits. The 
problem was the "ToInt32" method of an IntPtr which failed on mono 64 bits 
(have to use ToInt64 instead).
This path solve this problem.
Also, I have put marshaling complexity of the ConnectOpenAuth callback in 
bindings, this make the callback of ConnectOpenAuth more simple to achieve the 
authentification. In the example, the callback is treated like this :

private static int AuthCallback(ref ConnectCredential[] creds, IntPtr cbdata)
{
AuthData authData = (AuthData)Marshal.PtrToStructure(cbdata, 
typeof(AuthData));
foreach (ConnectCredential cred in creds)
{
switch (cred.type)
{
case ConnectCredentialType.VIR_CRED_AUTHNAME:
// Fill the user name
cred.Result = authData.user_name;
break;
case ConnectCredentialType.VIR_CRED_PASSPHRASE:
// Fill the password
cred.Result = authData.password;
break;
default:
return -1;
}
}
return 0;
}

The bindings user has no marshaling to do, and believe me, it's simpler.

Finally, this patch finalize renaming.

Best regards,

Arnaud Champion





--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list 

0001-can-t-loop-thru-ref-array-in-mono.patch
Description: Binary data
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [libvirt-csharp][PATCH] Make examples works on monocompiled in 64 bits, simply the ConnectOpenAuth process, and finalise renaming

2010-10-27 Thread arnaud.champion
?Oops, I have made a little mistake that make the example not compiling. This 
patch make it works, sorry :S


From: arnaud.champ...@devatom.fr 
Sent: Wednesday, October 27, 2010 1:50 PM
To: libvir-list@redhat.com 
Subject: [libvirt] [libvirt-csharp][PATCH] Make examples works on monocompiled 
in 64 bits, simply the ConnectOpenAuth process,and finalise renaming


Hi,

I have finally find the problem with examples on mono compiled in 64 bits. The 
problem was the "ToInt32" method of an IntPtr which failed on mono 64 bits 
(have to use ToInt64 instead).
This path solve this problem.
Also, I have put marshaling complexity of the ConnectOpenAuth callback in 
bindings, this make the callback of ConnectOpenAuth more simple to achieve the 
authentification. In the example, the callback is treated like this :

private static int AuthCallback(ref ConnectCredential[] creds, IntPtr cbdata)
{
AuthData authData = (AuthData)Marshal.PtrToStructure(cbdata, 
typeof(AuthData));
foreach (ConnectCredential cred in creds)
{
switch (cred.type)
{
case ConnectCredentialType.VIR_CRED_AUTHNAME:
// Fill the user name
cred.Result = authData.user_name;
break;
case ConnectCredentialType.VIR_CRED_PASSPHRASE:
// Fill the password
cred.Result = authData.password;
break;
default:
return -1;
}
}
return 0;
}

The bindings user has no marshaling to do, and believe me, it's simpler.

Finally, this patch finalize renaming.

Best regards,

Arnaud Champion





--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

0001-Oops-a-little-thing-that-make-example-not-compile-un.patch
Description: Binary data
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] C# Bindings - rename classes fromvirConnectto Connect, virDomain to Domain, etc...

2010-10-23 Thread arnaud.champion
Okay well, the problem occurs under amd64 system only. The problem is 
around the marshal of the virConnectCredential structure.

I have marshalled it as this:

///
   /// Credential structure
   ///
   [StructLayout(LayoutKind.Sequential)]
   public struct virConnectCredential
   {
   ///
   /// One of virConnectCredentialType constants
   ///
   [MarshalAs(UnmanagedType.I4)]
   public virConnectCredentialType type;
   ///
   /// Prompt to show to user
   ///
   private IntPtr prompt;
   ///
   /// Additional challenge to show
   ///
   private IntPtr challenge;
   ///
   /// Optional default result
   ///
   private IntPtr defresult;
   ///
   /// Result to be filled with user response (or defresult). An IntPtr 
to a marshalled allocated string

   ///
   private IntPtr result;
   ///
   /// Length of the result
   ///
   [MarshalAs(UnmanagedType.U4)]
   public uint resultlen;
   ///
   /// Prompt to show to user
   ///
   public string Prompt
   {
   get
   {
   return Marshal.PtrToStringAnsi(prompt);
   }
   }
   ///
   /// Additional challenge to show
   ///
   public string Challenge
   {
   get
   {
   return Marshal.PtrToStringAnsi(challenge);
   }
   }
   ///
   /// Optional default result
   ///
   public string Defresult
   {
   get
   {
   return Marshal.PtrToStringAnsi(defresult);
   }
   }
   ///
   /// Result to be filled with user response (or defresult).
   ///
   public string Result
   {
   get
   {
   return Marshal.PtrToStringAnsi(result);
   }
   set
   {
   result = 
NativeFunctions.StrDup(Marshal.StringToHGlobalAnsi(value));

   }
   }
   }

The strange thing is that I have made test with this marshaling, it always 
work with on x86 (fedora or ubuntu) and failed marshaling on amd64 (ubuntu 
or fedora)


Anyone have an idea ?

Regards,

Arnaud
--
From: "Matthias Bolte" 
Sent: Thursday, October 21, 2010 3:59 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes fromvirConnectto 
Connect, virDomain to Domain, etc...


I think I have Mono AMD64 here as I'm running the AMD64 version of Ubuntu 
10.04.


Matthias

2010/10/21  :

Another question, are you using a x86 or a amd64 version of mono ?

--
From: 
Sent: Thursday, October 21, 2010 3:07 PM
To: ; "Matthias Bolte"

Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes 
fromvirConnectto

Connect, virDomain to Domain, etc...


Solved, I have compiled with --disable-nls and I have reproduced the
problem, but I have a lot of difficulties to find the solution, for 
now...

but I continue to search.

--
From: 
Sent: Thursday, October 21, 2010 10:57 AM
To: ; "Matthias Bolte"

Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes
fromvirConnectto Connect, virDomain to Domain, etc...


I have a compile problem under ubuntu 10.04.

I have used the git libvirt version. autogen run fine (I haven't used 
any

argument, so I try to compile all). But make give me this :

make[3]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt/tests'
make[2]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt/tests'
Making all in po
make[2]: Entering directory `/home/arnaud/Bureau/libvirt/libvirt/po'
test -z "af.gmo am.gmo ar.gmo as.gmo be.gmo bg.gmo bn.gmo bn_IN.gmo
bs.gmo ca.gmo cs.gmo cy.gmo da.gmo de.gmo el.gmo en_GB.gmo es.gmo 
et.gmo
eu_ES.gmo fa.gmo fi.gmo fr.gmo gl.gmo gu.gmo he.gmo hi.gmo hr.gmo 
hu.gmo
hy.gmo id.gmo is.gmo it.gmo ja.gmo ka.gmo kn.gmo ko.gmo ku.gmo lo.gmo 
lt.gmo

lv.gmo mk.gmo ml.gmo mr.gmo ms.gmo my.gmo nb.gmo nl.gmo nn.gmo nso.gmo
or.gmo pa.gmo pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo si.gmo sk.gmo 
sl.gmo
sq.gmo sr.gmo s...@latin.gmo sv.gmo ta.gmo te.gmo th.gmo tr.gmo uk.gmo 
ur.gmo

vi.gmo zh_CN.gmo zh_TW.gmo zu.gmo" || make af.gmo am.gmo ar.gmo as.gmo
be.gmo bg.gmo bn.gmo bn_IN.gmo bs.gmo ca.gmo cs.gmo cy.gmo da.gmo 
de.gmo
el.gmo en_GB.gmo es.gmo et.gmo eu_ES.gmo fa.gmo fi.gmo fr.gmo gl.gmo 
gu.gmo
he.gmo hi.gmo hr.gmo hu.gmo hy.gmo id.gmo is.gmo it.gmo ja.gmo ka.gmo 
kn.gmo
ko.gmo ku.gmo lo.gmo lt.gmo lv.gmo mk.gmo ml.gmo mr.gmo ms.gmo my.gmo 
nb.gmo
nl.gmo nn.gmo nso.gmo or.gmo pa.gmo pl.gmo pt.gmo pt_BR.gmo ro.gmo 
ru.gmo
si.gmo sk.gmo sl.gmo sq.gmo sr.gmo s...@latin.gmo sv.gmo ta.gmo te.gmo 
th.gmo

tr.gmo uk.gmo ur.gmo vi.gmo zh_CN.gmo zh_TW.gmo zu.gmo
make[3]: Entering directory `/home/arnaud/Bureau/libvirt/libvirt/po'
: --update af.po libvirt.pot
rm -f af.gmo && : -c --statistics -o af.gmo af.po
mv: cannot stat `t-af.gmo': No such file or directory
make[3]: *** [af

Re: [libvirt] [PATCH] C# Bindings - rename classes fromvirConnectto Connect, virDomain to Domain, etc...

2010-10-21 Thread arnaud.champion

Another question, are you using a x86 or a amd64 version of mono ?

--
From: 
Sent: Thursday, October 21, 2010 3:07 PM
To: ; "Matthias Bolte" 


Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes fromvirConnectto 
Connect, virDomain to Domain, etc...


Solved, I have compiled with --disable-nls and I have reproduced the 
problem, but I have a lot of difficulties to find the solution, for now... 
but I continue to search.


--
From: 
Sent: Thursday, October 21, 2010 10:57 AM
To: ; "Matthias Bolte" 


Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes 
fromvirConnectto Connect, virDomain to Domain, etc...



I have a compile problem under ubuntu 10.04.

I have used the git libvirt version. autogen run fine (I haven't used any 
argument, so I try to compile all). But make give me this :


make[3]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt/tests'
make[2]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt/tests'
Making all in po
make[2]: Entering directory `/home/arnaud/Bureau/libvirt/libvirt/po'
test -z "af.gmo am.gmo ar.gmo as.gmo be.gmo bg.gmo bn.gmo bn_IN.gmo 
bs.gmo ca.gmo cs.gmo cy.gmo da.gmo de.gmo el.gmo en_GB.gmo es.gmo et.gmo 
eu_ES.gmo fa.gmo fi.gmo fr.gmo gl.gmo gu.gmo he.gmo hi.gmo hr.gmo hu.gmo 
hy.gmo id.gmo is.gmo it.gmo ja.gmo ka.gmo kn.gmo ko.gmo ku.gmo lo.gmo 
lt.gmo lv.gmo mk.gmo ml.gmo mr.gmo ms.gmo my.gmo nb.gmo nl.gmo nn.gmo 
nso.gmo or.gmo pa.gmo pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo si.gmo sk.gmo 
sl.gmo sq.gmo sr.gmo s...@latin.gmo sv.gmo ta.gmo te.gmo th.gmo tr.gmo 
uk.gmo ur.gmo vi.gmo zh_CN.gmo zh_TW.gmo zu.gmo" || make af.gmo am.gmo 
ar.gmo as.gmo be.gmo bg.gmo bn.gmo bn_IN.gmo bs.gmo ca.gmo cs.gmo cy.gmo 
da.gmo de.gmo el.gmo en_GB.gmo es.gmo et.gmo eu_ES.gmo fa.gmo fi.gmo 
fr.gmo gl.gmo gu.gmo he.gmo hi.gmo hr.gmo hu.gmo hy.gmo id.gmo is.gmo 
it.gmo ja.gmo ka.gmo kn.gmo ko.gmo ku.gmo lo.gmo lt.gmo lv.gmo mk.gmo 
ml.gmo mr.gmo ms.gmo my.gmo nb.gmo nl.gmo nn.gmo nso.gmo or.gmo pa.gmo 
pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo si.gmo sk.gmo sl.gmo sq.gmo sr.gmo 
s...@latin.gmo sv.gmo ta.gmo te.gmo th.gmo tr.gmo uk.gmo ur.gmo vi.gmo 
zh_CN.gmo zh_TW.gmo zu.gmo

make[3]: Entering directory `/home/arnaud/Bureau/libvirt/libvirt/po'
: --update af.po libvirt.pot
rm -f af.gmo && : -c --statistics -o af.gmo af.po
mv: cannot stat `t-af.gmo': No such file or directory
make[3]: *** [af.gmo] Error 1
make[3]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt/po'
make[2]: *** [stamp-po] Error 2
make[2]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt/po'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt'
make: *** [all] Erreur 2

Maybe I have to remove certains things via --without at configure, but I 
don't know what.


Arnaud

--
From: 
Sent: Thursday, October 21, 2010 10:28 AM
To: "Matthias Bolte" 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes 
fromvirConnectto Connect, virDomain to Domain, etc...


argh, esx support is not compiled by default in ubuntu. I have to take 
the time to compile libvirt.


--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 11:23 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from 
virConnectto Connect, virDomain to Domain, etc...



I'm testing on Ubuntu 10.04 with

mono 2.4.4~svn151842-1ubuntu4
monodevelop 2.2.1+dfsg-1ubuntu2

and libvirt and libvirt-csharp from git.

Matthias

2010/10/20  :
It seems that the marshaling of the virConnectCredential structure 
failed,
but I only said that by view your debug traces. Can you say me which 
are the
environment of Mono (which version of Mono, which MonoDevelop, these 
kind of

things) ? because I have no idea about what's going wrong, I have to
reproduce the case on my system to debug correctly.

Arnaud

--
From: 
Sent: Wednesday, October 20, 2010 9:07 PM
To: "Matthias Bolte" 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from
virConnectto Connect, virDomain to Domain, etc...


It's strange it works on my linux :S

--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 8:02 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from
virConnect to Connect, virDomain to Domain, etc...

The transport shouldn't make a difference. To make it work with 
HTTPS
you'll have to replace the self-signed certificates on the ESX 
server

or tell libvirt to disable server certificate checks using:

 esx://192.168.0.17/?no_verify=1

Matthias

2010/10/20  :


Okay I'll take a look, is the transport in http ? (just to be 
curious, I

haven't been able to make it work in https)

--
From: "Matthias Bolte" 
Sent

Re: [libvirt] [PATCH] C# Bindings - rename classes fromvirConnectto Connect, virDomain to Domain, etc...

2010-10-21 Thread arnaud.champion
Solved, I have compiled with --disable-nls and I have reproduced the 
problem, but I have a lot of difficulties to find the solution, for now... 
but I continue to search.


--
From: 
Sent: Thursday, October 21, 2010 10:57 AM
To: ; "Matthias Bolte" 


Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes fromvirConnectto 
Connect, virDomain to Domain, etc...



I have a compile problem under ubuntu 10.04.

I have used the git libvirt version. autogen run fine (I haven't used any 
argument, so I try to compile all). But make give me this :


make[3]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt/tests'
make[2]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt/tests'
Making all in po
make[2]: Entering directory `/home/arnaud/Bureau/libvirt/libvirt/po'
test -z "af.gmo am.gmo ar.gmo as.gmo be.gmo bg.gmo bn.gmo bn_IN.gmo bs.gmo 
ca.gmo cs.gmo cy.gmo da.gmo de.gmo el.gmo en_GB.gmo es.gmo et.gmo 
eu_ES.gmo fa.gmo fi.gmo fr.gmo gl.gmo gu.gmo he.gmo hi.gmo hr.gmo hu.gmo 
hy.gmo id.gmo is.gmo it.gmo ja.gmo ka.gmo kn.gmo ko.gmo ku.gmo lo.gmo 
lt.gmo lv.gmo mk.gmo ml.gmo mr.gmo ms.gmo my.gmo nb.gmo nl.gmo nn.gmo 
nso.gmo or.gmo pa.gmo pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo si.gmo sk.gmo 
sl.gmo sq.gmo sr.gmo s...@latin.gmo sv.gmo ta.gmo te.gmo th.gmo tr.gmo 
uk.gmo ur.gmo vi.gmo zh_CN.gmo zh_TW.gmo zu.gmo" || make af.gmo am.gmo 
ar.gmo as.gmo be.gmo bg.gmo bn.gmo bn_IN.gmo bs.gmo ca.gmo cs.gmo cy.gmo 
da.gmo de.gmo el.gmo en_GB.gmo es.gmo et.gmo eu_ES.gmo fa.gmo fi.gmo 
fr.gmo gl.gmo gu.gmo he.gmo hi.gmo hr.gmo hu.gmo hy.gmo id.gmo is.gmo 
it.gmo ja.gmo ka.gmo kn.gmo ko.gmo ku.gmo lo.gmo lt.gmo lv.gmo mk.gmo 
ml.gmo mr.gmo ms.gmo my.gmo nb.gmo nl.gmo nn.gmo nso.gmo or.gmo pa.gmo 
pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo si.gmo sk.gmo sl.gmo sq.gmo sr.gmo 
s...@latin.gmo sv.gmo ta.gmo te.gmo th.gmo tr.gmo uk.gmo ur.gmo vi.gmo 
zh_CN.gmo zh_TW.gmo zu.gmo

make[3]: Entering directory `/home/arnaud/Bureau/libvirt/libvirt/po'
: --update af.po libvirt.pot
rm -f af.gmo && : -c --statistics -o af.gmo af.po
mv: cannot stat `t-af.gmo': No such file or directory
make[3]: *** [af.gmo] Error 1
make[3]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt/po'
make[2]: *** [stamp-po] Error 2
make[2]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt/po'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt'
make: *** [all] Erreur 2

Maybe I have to remove certains things via --without at configure, but I 
don't know what.


Arnaud

--
From: 
Sent: Thursday, October 21, 2010 10:28 AM
To: "Matthias Bolte" 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes 
fromvirConnectto Connect, virDomain to Domain, etc...


argh, esx support is not compiled by default in ubuntu. I have to take 
the time to compile libvirt.


--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 11:23 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from 
virConnectto Connect, virDomain to Domain, etc...



I'm testing on Ubuntu 10.04 with

mono 2.4.4~svn151842-1ubuntu4
monodevelop 2.2.1+dfsg-1ubuntu2

and libvirt and libvirt-csharp from git.

Matthias

2010/10/20  :
It seems that the marshaling of the virConnectCredential structure 
failed,
but I only said that by view your debug traces. Can you say me which 
are the
environment of Mono (which version of Mono, which MonoDevelop, these 
kind of

things) ? because I have no idea about what's going wrong, I have to
reproduce the case on my system to debug correctly.

Arnaud

--
From: 
Sent: Wednesday, October 20, 2010 9:07 PM
To: "Matthias Bolte" 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from
virConnectto Connect, virDomain to Domain, etc...


It's strange it works on my linux :S

--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 8:02 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from
virConnect to Connect, virDomain to Domain, etc...


The transport shouldn't make a difference. To make it work with HTTPS
you'll have to replace the self-signed certificates on the ESX server
or tell libvirt to disable server certificate checks using:

 esx://192.168.0.17/?no_verify=1

Matthias

2010/10/20  :


Okay I'll take a look, is the transport in http ? (just to be 
curious, I

haven't been able to make it work in https)

--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 6:35 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from
virConnect
to Connect, virDomain to Domain, etc...


2010/10/20  :


This patch rename file / classes from virConnect to Connect, 
virDomain

to
Domain, etc...

Arnaud


I pushed this one too and did a pat

Re: [libvirt] [PATCH] C# Bindings - rename classes fromvirConnectto Connect, virDomain to Domain, etc...

2010-10-21 Thread arnaud.champion

I have a compile problem under ubuntu 10.04.

I have used the git libvirt version. autogen run fine (I haven't used any 
argument, so I try to compile all). But make give me this :


make[3]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt/tests'
make[2]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt/tests'
Making all in po
make[2]: Entering directory `/home/arnaud/Bureau/libvirt/libvirt/po'
test -z "af.gmo am.gmo ar.gmo as.gmo be.gmo bg.gmo bn.gmo bn_IN.gmo bs.gmo 
ca.gmo cs.gmo cy.gmo da.gmo de.gmo el.gmo en_GB.gmo es.gmo et.gmo eu_ES.gmo 
fa.gmo fi.gmo fr.gmo gl.gmo gu.gmo he.gmo hi.gmo hr.gmo hu.gmo hy.gmo id.gmo 
is.gmo it.gmo ja.gmo ka.gmo kn.gmo ko.gmo ku.gmo lo.gmo lt.gmo lv.gmo mk.gmo 
ml.gmo mr.gmo ms.gmo my.gmo nb.gmo nl.gmo nn.gmo nso.gmo or.gmo pa.gmo 
pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo si.gmo sk.gmo sl.gmo sq.gmo sr.gmo 
s...@latin.gmo sv.gmo ta.gmo te.gmo th.gmo tr.gmo uk.gmo ur.gmo vi.gmo 
zh_CN.gmo zh_TW.gmo zu.gmo" || make af.gmo am.gmo ar.gmo as.gmo be.gmo 
bg.gmo bn.gmo bn_IN.gmo bs.gmo ca.gmo cs.gmo cy.gmo da.gmo de.gmo el.gmo 
en_GB.gmo es.gmo et.gmo eu_ES.gmo fa.gmo fi.gmo fr.gmo gl.gmo gu.gmo he.gmo 
hi.gmo hr.gmo hu.gmo hy.gmo id.gmo is.gmo it.gmo ja.gmo ka.gmo kn.gmo ko.gmo 
ku.gmo lo.gmo lt.gmo lv.gmo mk.gmo ml.gmo mr.gmo ms.gmo my.gmo nb.gmo nl.gmo 
nn.gmo nso.gmo or.gmo pa.gmo pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo si.gmo 
sk.gmo sl.gmo sq.gmo sr.gmo s...@latin.gmo sv.gmo ta.gmo te.gmo th.gmo tr.gmo 
uk.gmo ur.gmo vi.gmo zh_CN.gmo zh_TW.gmo zu.gmo

make[3]: Entering directory `/home/arnaud/Bureau/libvirt/libvirt/po'
: --update af.po libvirt.pot
rm -f af.gmo && : -c --statistics -o af.gmo af.po
mv: cannot stat `t-af.gmo': No such file or directory
make[3]: *** [af.gmo] Error 1
make[3]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt/po'
make[2]: *** [stamp-po] Error 2
make[2]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt/po'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/arnaud/Bureau/libvirt/libvirt'
make: *** [all] Erreur 2

Maybe I have to remove certains things via --without at configure, but I 
don't know what.


Arnaud

--
From: 
Sent: Thursday, October 21, 2010 10:28 AM
To: "Matthias Bolte" 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes fromvirConnectto 
Connect, virDomain to Domain, etc...


argh, esx support is not compiled by default in ubuntu. I have to take the 
time to compile libvirt.


--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 11:23 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from 
virConnectto Connect, virDomain to Domain, etc...



I'm testing on Ubuntu 10.04 with

mono 2.4.4~svn151842-1ubuntu4
monodevelop 2.2.1+dfsg-1ubuntu2

and libvirt and libvirt-csharp from git.

Matthias

2010/10/20  :
It seems that the marshaling of the virConnectCredential structure 
failed,
but I only said that by view your debug traces. Can you say me which are 
the
environment of Mono (which version of Mono, which MonoDevelop, these 
kind of

things) ? because I have no idea about what's going wrong, I have to
reproduce the case on my system to debug correctly.

Arnaud

--
From: 
Sent: Wednesday, October 20, 2010 9:07 PM
To: "Matthias Bolte" 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from
virConnectto Connect, virDomain to Domain, etc...


It's strange it works on my linux :S

--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 8:02 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from
virConnect to Connect, virDomain to Domain, etc...


The transport shouldn't make a difference. To make it work with HTTPS
you'll have to replace the self-signed certificates on the ESX server
or tell libvirt to disable server certificate checks using:

 esx://192.168.0.17/?no_verify=1

Matthias

2010/10/20  :


Okay I'll take a look, is the transport in http ? (just to be 
curious, I

haven't been able to make it work in https)

--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 6:35 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from
virConnect
to Connect, virDomain to Domain, etc...


2010/10/20  :


This patch rename file / classes from virConnect to Connect, 
virDomain

to
Domain, etc...

Arnaud


I pushed this one too and did a patch remove trailing white spaces 
on

top.

I tested the bindings by successfully compiling and using the
virConnectOpen example on Linux in MonoDevelop.

The virConnectOpenAuth example throws a 
System.NullReferenceException

when I try to connect to an ESX server.

Marshaling clicked signal
Exception in Gtk# callback delegate
 Note: Applications can use GLib.ExceptionManager.UnhandledException
to handle the exception.

Re: [libvirt] [PATCH] C# Bindings - rename classes from virConnectto Connect, virDomain to Domain, etc...

2010-10-21 Thread arnaud.champion
argh, esx support is not compiled by default in ubuntu. I have to take the 
time to compile libvirt.


--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 11:23 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from 
virConnectto Connect, virDomain to Domain, etc...



I'm testing on Ubuntu 10.04 with

mono 2.4.4~svn151842-1ubuntu4
monodevelop 2.2.1+dfsg-1ubuntu2

and libvirt and libvirt-csharp from git.

Matthias

2010/10/20  :
It seems that the marshaling of the virConnectCredential structure 
failed,
but I only said that by view your debug traces. Can you say me which are 
the
environment of Mono (which version of Mono, which MonoDevelop, these kind 
of

things) ? because I have no idea about what's going wrong, I have to
reproduce the case on my system to debug correctly.

Arnaud

--
From: 
Sent: Wednesday, October 20, 2010 9:07 PM
To: "Matthias Bolte" 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from
virConnectto Connect, virDomain to Domain, etc...


It's strange it works on my linux :S

--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 8:02 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from
virConnect to Connect, virDomain to Domain, etc...


The transport shouldn't make a difference. To make it work with HTTPS
you'll have to replace the self-signed certificates on the ESX server
or tell libvirt to disable server certificate checks using:

 esx://192.168.0.17/?no_verify=1

Matthias

2010/10/20  :


Okay I'll take a look, is the transport in http ? (just to be curious, 
I

haven't been able to make it work in https)

--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 6:35 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from
virConnect
to Connect, virDomain to Domain, etc...


2010/10/20  :


This patch rename file / classes from virConnect to Connect, 
virDomain

to
Domain, etc...

Arnaud


I pushed this one too and did a patch remove trailing white spaces on
top.

I tested the bindings by successfully compiling and using the
virConnectOpen example on Linux in MonoDevelop.

The virConnectOpenAuth example throws a System.NullReferenceException
when I try to connect to an ESX server.

Marshaling clicked signal
Exception in Gtk# callback delegate
 Note: Applications can use GLib.ExceptionManager.UnhandledException
to handle the exception.
System.Reflection.TargetInvocationException: Exception has been 
thrown

by the target of an invocation. ---> System.NullReferenceException:
Object reference not set to an instance of an object
 at System.String.memcpy4 (System.Byte* dest, System.Byte* src, Int32
size) [0x0]
 at System.String.memcpy (System.Byte* dest, System.Byte* src, Int32
size) [0x0]
 at (wrapper unknown) Libvirt.virConnectCredential:PtrToStructure
(intptr,object)
 at (wrapper managed-to-native)
System.Runtime.InteropServices.Marshal:PtrToStructure
(intptr,System.Type)
 at MainWindow.AuthCallback (IntPtr creds, UInt32 ncred, IntPtr
cbdata) [0x00034] in


.../libvirt-csharp-upstream/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs:146
 at (wrapper native-to-managed) MainWindow:AuthCallback
(intptr,uint,intptr)
 at (wrapper managed-to-native) Libvirt.Connect:OpenAuth
(string,Libvirt.virConnectAuth&,int)
 at MainWindow.OnButton1Clicked (System.Object sender,
System.EventArgs e) [0x00069] in


.../libvirt-csharp-upstream/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs:64
 at (wrapper managed-to-native)
System.Reflection.MonoMethod:InternalInvoke
(object,object[],System.Exception&)
 at System.Reflection.MonoMethod.Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
[0x0]
 --- End of inner exception stack trace ---
 at System.Reflection.MonoMethod.Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
[0x0]
 at System.Reflection.MethodBase.Invoke (System.Object obj,
System.Object[] parameters) [0x0]
 at System.Delegate.DynamicInvokeImpl (System.Object[] args) 
[0x0]

 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args)
[0x0]
 at System.Delegate.DynamicInvoke (System.Object[] args) [0x0]
 at GLib.Signal.ClosureInvokedCB (System.Object o,
GLib.ClosureInvokedArgs args) [0x0]
 at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) 
[0x0]

 at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr
return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr
invocation_hint, IntPtr marshal_data) [0x0]
 at GLib.ExceptionManager.RaiseUnhandledException(System.Exception
e, Boolean is_terminal)
 at GLib.SignalClosure.M

Re: [libvirt] [PATCH] C# Bindings - rename classes from virConnectto Connect, virDomain to Domain, etc...

2010-10-20 Thread arnaud.champion
It seems that the marshaling of the virConnectCredential structure failed, 
but I only said that by view your debug traces. Can you say me which are the 
environment of Mono (which version of Mono, which MonoDevelop, these kind of 
things) ? because I have no idea about what's going wrong, I have to 
reproduce the case on my system to debug correctly.


Arnaud

--
From: 
Sent: Wednesday, October 20, 2010 9:07 PM
To: "Matthias Bolte" 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from 
virConnectto Connect, virDomain to Domain, etc...



It's strange it works on my linux :S

--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 8:02 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from 
virConnect to Connect, virDomain to Domain, etc...



The transport shouldn't make a difference. To make it work with HTTPS
you'll have to replace the self-signed certificates on the ESX server
or tell libvirt to disable server certificate checks using:

 esx://192.168.0.17/?no_verify=1

Matthias

2010/10/20  :

Okay I'll take a look, is the transport in http ? (just to be curious, I
haven't been able to make it work in https)

--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 6:35 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from 
virConnect

to Connect, virDomain to Domain, etc...


2010/10/20  :


This patch rename file / classes from virConnect to Connect, virDomain 
to

Domain, etc...

Arnaud


I pushed this one too and did a patch remove trailing white spaces on 
top.


I tested the bindings by successfully compiling and using the
virConnectOpen example on Linux in MonoDevelop.

The virConnectOpenAuth example throws a System.NullReferenceException
when I try to connect to an ESX server.

Marshaling clicked signal
Exception in Gtk# callback delegate
 Note: Applications can use GLib.ExceptionManager.UnhandledException
to handle the exception.
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. ---> System.NullReferenceException:
Object reference not set to an instance of an object
 at System.String.memcpy4 (System.Byte* dest, System.Byte* src, Int32
size) [0x0]
 at System.String.memcpy (System.Byte* dest, System.Byte* src, Int32
size) [0x0]
 at (wrapper unknown) Libvirt.virConnectCredential:PtrToStructure
(intptr,object)
 at (wrapper managed-to-native)
System.Runtime.InteropServices.Marshal:PtrToStructure
(intptr,System.Type)
 at MainWindow.AuthCallback (IntPtr creds, UInt32 ncred, IntPtr
cbdata) [0x00034] in

.../libvirt-csharp-upstream/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs:146
 at (wrapper native-to-managed) MainWindow:AuthCallback
(intptr,uint,intptr)
 at (wrapper managed-to-native) Libvirt.Connect:OpenAuth
(string,Libvirt.virConnectAuth&,int)
 at MainWindow.OnButton1Clicked (System.Object sender,
System.EventArgs e) [0x00069] in

.../libvirt-csharp-upstream/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs:64
 at (wrapper managed-to-native)
System.Reflection.MonoMethod:InternalInvoke
(object,object[],System.Exception&)
 at System.Reflection.MonoMethod.Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
[0x0]
 --- End of inner exception stack trace ---
 at System.Reflection.MonoMethod.Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
[0x0]
 at System.Reflection.MethodBase.Invoke (System.Object obj,
System.Object[] parameters) [0x0]
 at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x0]
 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args)
[0x0]
 at System.Delegate.DynamicInvoke (System.Object[] args) [0x0]
 at GLib.Signal.ClosureInvokedCB (System.Object o,
GLib.ClosureInvokedArgs args) [0x0]
 at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x0]
 at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr
return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr
invocation_hint, IntPtr marshal_data) [0x0]
 at GLib.ExceptionManager.RaiseUnhandledException(System.Exception
e, Boolean is_terminal)
 at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr
return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr
invocation_hint, IntPtr marshal_data)
 at Gtk.Application.gtk_main()
 at Gtk.Application.Run()
 at virConnectOpenAuth.MainClass.Main(System.String[] args) in

.../libvirt-csharp-upstream/examples/MonoDevelop/virConnectOpenAuth/Main.cs:line
13

Matthias








--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list 



--
libvir-list mailing list
libvir-list@redh

Re: [libvirt] [PATCH] C# Bindings - rename classes from virConnect to Connect, virDomain to Domain, etc...

2010-10-20 Thread arnaud.champion

It's strange it works on my linux :S

--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 8:02 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from virConnect 
to Connect, virDomain to Domain, etc...



The transport shouldn't make a difference. To make it work with HTTPS
you'll have to replace the self-signed certificates on the ESX server
or tell libvirt to disable server certificate checks using:

 esx://192.168.0.17/?no_verify=1

Matthias

2010/10/20  :

Okay I'll take a look, is the transport in http ? (just to be curious, I
haven't been able to make it work in https)

--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 6:35 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from 
virConnect

to Connect, virDomain to Domain, etc...


2010/10/20  :


This patch rename file / classes from virConnect to Connect, virDomain 
to

Domain, etc...

Arnaud


I pushed this one too and did a patch remove trailing white spaces on 
top.


I tested the bindings by successfully compiling and using the
virConnectOpen example on Linux in MonoDevelop.

The virConnectOpenAuth example throws a System.NullReferenceException
when I try to connect to an ESX server.

Marshaling clicked signal
Exception in Gtk# callback delegate
 Note: Applications can use GLib.ExceptionManager.UnhandledException
to handle the exception.
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. ---> System.NullReferenceException:
Object reference not set to an instance of an object
 at System.String.memcpy4 (System.Byte* dest, System.Byte* src, Int32
size) [0x0]
 at System.String.memcpy (System.Byte* dest, System.Byte* src, Int32
size) [0x0]
 at (wrapper unknown) Libvirt.virConnectCredential:PtrToStructure
(intptr,object)
 at (wrapper managed-to-native)
System.Runtime.InteropServices.Marshal:PtrToStructure
(intptr,System.Type)
 at MainWindow.AuthCallback (IntPtr creds, UInt32 ncred, IntPtr
cbdata) [0x00034] in

.../libvirt-csharp-upstream/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs:146
 at (wrapper native-to-managed) MainWindow:AuthCallback
(intptr,uint,intptr)
 at (wrapper managed-to-native) Libvirt.Connect:OpenAuth
(string,Libvirt.virConnectAuth&,int)
 at MainWindow.OnButton1Clicked (System.Object sender,
System.EventArgs e) [0x00069] in

.../libvirt-csharp-upstream/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs:64
 at (wrapper managed-to-native)
System.Reflection.MonoMethod:InternalInvoke
(object,object[],System.Exception&)
 at System.Reflection.MonoMethod.Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
[0x0]
 --- End of inner exception stack trace ---
 at System.Reflection.MonoMethod.Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
[0x0]
 at System.Reflection.MethodBase.Invoke (System.Object obj,
System.Object[] parameters) [0x0]
 at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x0]
 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args)
[0x0]
 at System.Delegate.DynamicInvoke (System.Object[] args) [0x0]
 at GLib.Signal.ClosureInvokedCB (System.Object o,
GLib.ClosureInvokedArgs args) [0x0]
 at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x0]
 at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr
return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr
invocation_hint, IntPtr marshal_data) [0x0]
 at GLib.ExceptionManager.RaiseUnhandledException(System.Exception
e, Boolean is_terminal)
 at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr
return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr
invocation_hint, IntPtr marshal_data)
 at Gtk.Application.gtk_main()
 at Gtk.Application.Run()
 at virConnectOpenAuth.MainClass.Main(System.String[] args) in

.../libvirt-csharp-upstream/examples/MonoDevelop/virConnectOpenAuth/Main.cs:line
13

Matthias








--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] C# Bindings - rename classes from virConnect to Connect, virDomain to Domain, etc...

2010-10-20 Thread arnaud.champion
Okay I'll take a look, is the transport in http ? (just to be curious, I 
haven't been able to make it work in https)


--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 6:35 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C# Bindings - rename classes from virConnect 
to Connect, virDomain to Domain, etc...



2010/10/20  :

This patch rename file / classes from virConnect to Connect, virDomain to
Domain, etc...

Arnaud


I pushed this one too and did a patch remove trailing white spaces on top.

I tested the bindings by successfully compiling and using the
virConnectOpen example on Linux in MonoDevelop.

The virConnectOpenAuth example throws a System.NullReferenceException
when I try to connect to an ESX server.

Marshaling clicked signal
Exception in Gtk# callback delegate
 Note: Applications can use GLib.ExceptionManager.UnhandledException
to handle the exception.
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. ---> System.NullReferenceException:
Object reference not set to an instance of an object
 at System.String.memcpy4 (System.Byte* dest, System.Byte* src, Int32
size) [0x0]
 at System.String.memcpy (System.Byte* dest, System.Byte* src, Int32
size) [0x0]
 at (wrapper unknown) Libvirt.virConnectCredential:PtrToStructure
(intptr,object)
 at (wrapper managed-to-native)
System.Runtime.InteropServices.Marshal:PtrToStructure
(intptr,System.Type)
 at MainWindow.AuthCallback (IntPtr creds, UInt32 ncred, IntPtr
cbdata) [0x00034] in
.../libvirt-csharp-upstream/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs:146
 at (wrapper native-to-managed) MainWindow:AuthCallback 
(intptr,uint,intptr)

 at (wrapper managed-to-native) Libvirt.Connect:OpenAuth
(string,Libvirt.virConnectAuth&,int)
 at MainWindow.OnButton1Clicked (System.Object sender,
System.EventArgs e) [0x00069] in
.../libvirt-csharp-upstream/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs:64
 at (wrapper managed-to-native)
System.Reflection.MonoMethod:InternalInvoke
(object,object[],System.Exception&)
 at System.Reflection.MonoMethod.Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
[0x0]
 --- End of inner exception stack trace ---
 at System.Reflection.MonoMethod.Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
[0x0]
 at System.Reflection.MethodBase.Invoke (System.Object obj,
System.Object[] parameters) [0x0]
 at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x0]
 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args)
[0x0]
 at System.Delegate.DynamicInvoke (System.Object[] args) [0x0]
 at GLib.Signal.ClosureInvokedCB (System.Object o,
GLib.ClosureInvokedArgs args) [0x0]
 at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x0]
 at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr
return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr
invocation_hint, IntPtr marshal_data) [0x0]
  at GLib.ExceptionManager.RaiseUnhandledException(System.Exception
e, Boolean is_terminal)
  at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr
return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr
invocation_hint, IntPtr marshal_data)
  at Gtk.Application.gtk_main()
  at Gtk.Application.Run()
  at virConnectOpenAuth.MainClass.Main(System.String[] args) in
.../libvirt-csharp-upstream/examples/MonoDevelop/virConnectOpenAuth/Main.cs:line
13

Matthias 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] C#Bindings patch, rename classes

2010-10-20 Thread arnaud.champion
?You're are right. I just reference my own experience. Anyway, I'm putting 
Stream.


--
From: "Daniel P. Berrange" 
Sent: Wednesday, October 20, 2010 2:59 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C#Bindings patch, rename classes

On Wed, Oct 20, 2010 at 02:56:37PM +0200, arnaud.champ...@devatom.fr 
wrote:

?virStream will expose problems also, as Stream is also a class in .Net
framework


Why is that any problem ? Namespaces exist precisely to solve this 
problem.

You only need name uniqueness within the namespace.

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




--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] C#Bindings patch, rename classes

2010-10-20 Thread arnaud.champion
?virStream will expose problems also, as Stream is also a class in .Net 
framework


--
From: 
Sent: Wednesday, October 20, 2010 2:26 PM
To: "Daniel P. Berrange" 
Cc: 
Subject: Re: [libvirt] [PATCH] C#Bindings patch, rename classes

?I just found "Error" too large for the person who will use C# bindings :S 
but... I can use Error, technically no problem.


PS : I don't know exactly the english word, by too large I just want to 
avoid confusion


--
From: "Daniel P. Berrange" 
Sent: Wednesday, October 20, 2010 2:21 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C#Bindings patch, rename classes

On Wed, Oct 20, 2010 at 02:07:45PM +0200, arnaud.champ...@devatom.fr 
wrote:

?Okay, I'll make the change... Currently at naming level, my problem is
around Error class. Do you have a suggestion ?


What's wrong with following the example I gave, eg

 namespace Libvirt [

   public class Error {
   ...


>
>IMHO
>
>namespace LibvirtBindings
>{
>public class virDomain
>{
>
>
>Is somewhat redundant and better named
>
>namespace Libvirt
>{
>public class Domain
>{
>
>
>
>The 'vir' prefix on C library APIs/structs is just a hack because C
>does not have any concept of namespaces. It shouldn't be copied into
>languages which do have proper namespace support
>


Daniel
--
|: Red Hat, Engineering, London-o- http://people.redhat.com/berrange/ 
:|
|: http://libvirt.org -o- http://virt-manager.org -o- 
http://deltacloud.org :|

|: http://autobuild.org-o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 
9505 :|




--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] C#Bindings patch, rename classes

2010-10-20 Thread arnaud.champion
?I just found "Error" too large for the person who will use C# bindings :S 
but... I can use Error, technically no problem.


PS : I don't know exactly the english word, by too large I just want to 
avoid confusion


--
From: "Daniel P. Berrange" 
Sent: Wednesday, October 20, 2010 2:21 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C#Bindings patch, rename classes

On Wed, Oct 20, 2010 at 02:07:45PM +0200, arnaud.champ...@devatom.fr 
wrote:

?Okay, I'll make the change... Currently at naming level, my problem is
around Error class. Do you have a suggestion ?


What's wrong with following the example I gave, eg

 namespace Libvirt [

   public class Error {
   ...


>
>IMHO
>
>namespace LibvirtBindings
>{
>public class virDomain
>{
>
>
>Is somewhat redundant and better named
>
>namespace Libvirt
>{
>public class Domain
>{
>
>
>
>The 'vir' prefix on C library APIs/structs is just a hack because C
>does not have any concept of namespaces. It shouldn't be copied into
>languages which do have proper namespace support
>


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




--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] C#Bindings patch, rename classes

2010-10-20 Thread arnaud.champion
?Okay, I'll make the change... Currently at naming level, my problem is 
around Error class. Do you have a suggestion ?


--
From: "Daniel P. Berrange" 
Sent: Wednesday, October 20, 2010 2:01 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] C#Bindings patch, rename classes

On Wed, Oct 20, 2010 at 01:44:56PM +0200, arnaud.champ...@devatom.fr 
wrote:

?Hi,

here is a new patch. It propose to separate types of function by classes. 
For example :


all virConnect[*] (virConnectOpen, virConnectNumOfDomains, etc...) 
functions are in the virConnect class.
all virDomain[*] (virDomainCreate, virDomainDestroy, etc...) function are 
in the virDomain class.


so we have these classes now :

virConnect
virDomain
virEvent
virInterface
virLibrary
virNetwork
virNode
virSecret
virStoragePool
virStorageVol
virStream


IMHO

namespace LibvirtBindings
{
public class virDomain
{


Is somewhat redundant and better named

namespace Libvirt
{
public class Domain
{



The 'vir' prefix on C library APIs/structs is just a hack because C
does not have any concept of namespaces. It shouldn't be copied into
languages which do have proper namespace support

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




--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] Change/create solution and project for VisualStudio and MonoDevelop for C# bindings

2010-10-20 Thread arnaud.champion

Well it works fine, DllMap make the trick.

--
From: 
Sent: Wednesday, October 20, 2010 12:13 PM
To: "Matthias Bolte" 
Cc: 
Subject: Re: [libvirt] [PATCH] Change/create solution and project for 
VisualStudio and MonoDevelop for C# bindings



Impeccable ;)

--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 12:12 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] Change/create solution and project for 
Visual Studio and MonoDevelop for C# bindings



2010/10/20  :
The problem with DllMap, is that it works only under Mono, not under 
.Net :(


Well, no problem three. You keep the [DllImport("libvirt-0.dll")] in
the code for .Net, so it works for .Net and add a DllMap that tells
Mono that it should use libvirt.so.0 on Linux instead of libvirt-0.dll
etc. I think this is exactly how DllMap is supposed to be used.

Matthias


--
From: "Matthias Bolte" 
Sent: Tuesday, October 19, 2010 6:38 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] Change/create solution and project for 
Visual

Studio and MonoDevelop for C# bindings


2010/10/19  :


Hi,

here are 2 patches for C# libvirt bindings.

These patches create a new solution/project couple for Visual Studio 
2010

with also a sample code and a solution/project couple for MonoDevelop
with a
sample code also.

The sample code have been tested under .Net/Windows, Mono/Windows and
Mono/Linux. And it works, the sample code consist of the using au
virConnectOpenAuth and callback handling. It connect to a URI (I have
made
my tests with ESX hypervisor only) and list domains in a listbox.

So, to summarize, code work under linux or windows, the binary library
name
depends of a project directive (a kind of pragma). When the directive
WINDOWS is declared, DllImport will try to find "libvirt-0.dll" (for
windows) otherwise it looks for "libvirt.so.0" (for linux). For now, 
in

the
same manner, when the directive WINDOWS is declared, we find _strdup 
in

"msvcrt.dll" otherwise we look in "libc.so.6".


This makes the resulting binary platform dependent. I asked a friend
about this and he suggested to use Mono's dllmap feature [1]. It
allows you to stick with [DllImport("libvirt-0.dll")] in the code for
.Net and have Mono use libvirt.so.0 on Linux and libvirt.dylib on OSX.
This result in a platform independent binary regarding this issue.

[1] http://www.mono-project.com/Config_DllMap


I'm currently trying to remove strdup call by Custom Marshaling but it
seems
that .Net (or Mono anyway) doesn't allow to use custom marshaler with
structure (and we need it for virConnectCredential structure). If 
anyone

had
an idea...


Regarding this issue my friend suggested to stop libvirt from taking
ownership of cred.result. We could do that by making
virConnectOpenAuth take a new VIR_CONNECT_COPY_CRED_RESULT (or
VIR_CONNECT_DONT_FREE_CRED_RESULT or VIR_CONNECT_CONST_CRED_RESULT)
flag that lets libvirt internally strdup() cred.result before passing
it to the driver. That way the C# bindings could pass a managed string
as cred.result and we don't need to Marshal.StringToHGlobalAuto() and
strdup in C# at all.

Or we could make libvirt take a custom free function to free
cred.result instead of free(). That way Marshal.FreeHGlobal could be
used or no free function at all and you pass a managed string to it.
This would probably require a new version of virConnectOpenAuth and I
consider this as too invasive.

Another possibility would be to add a public virAlloc to libvirt that
C# can use to allocate memory that can be freed using free().

Matthias






--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list 



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] Change/create solution and project for Visual Studio and MonoDevelop for C# bindings

2010-10-20 Thread arnaud.champion

Impeccable ;)

--
From: "Matthias Bolte" 
Sent: Wednesday, October 20, 2010 12:12 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] Change/create solution and project for Visual 
Studio and MonoDevelop for C# bindings



2010/10/20  :
The problem with DllMap, is that it works only under Mono, not under .Net 
:(


Well, no problem three. You keep the [DllImport("libvirt-0.dll")] in
the code for .Net, so it works for .Net and add a DllMap that tells
Mono that it should use libvirt.so.0 on Linux instead of libvirt-0.dll
etc. I think this is exactly how DllMap is supposed to be used.

Matthias


--
From: "Matthias Bolte" 
Sent: Tuesday, October 19, 2010 6:38 PM
To: 
Cc: 
Subject: Re: [libvirt] [PATCH] Change/create solution and project for 
Visual

Studio and MonoDevelop for C# bindings


2010/10/19  :


Hi,

here are 2 patches for C# libvirt bindings.

These patches create a new solution/project couple for Visual Studio 
2010

with also a sample code and a solution/project couple for MonoDevelop
with a
sample code also.

The sample code have been tested under .Net/Windows, Mono/Windows and
Mono/Linux. And it works, the sample code consist of the using au
virConnectOpenAuth and callback handling. It connect to a URI (I have
made
my tests with ESX hypervisor only) and list domains in a listbox.

So, to summarize, code work under linux or windows, the binary library
name
depends of a project directive (a kind of pragma). When the directive
WINDOWS is declared, DllImport will try to find "libvirt-0.dll" (for
windows) otherwise it looks for "libvirt.so.0" (for linux). For now, in
the
same manner, when the directive WINDOWS is declared, we find _strdup in
"msvcrt.dll" otherwise we look in "libc.so.6".


This makes the resulting binary platform dependent. I asked a friend
about this and he suggested to use Mono's dllmap feature [1]. It
allows you to stick with [DllImport("libvirt-0.dll")] in the code for
.Net and have Mono use libvirt.so.0 on Linux and libvirt.dylib on OSX.
This result in a platform independent binary regarding this issue.

[1] http://www.mono-project.com/Config_DllMap


I'm currently trying to remove strdup call by Custom Marshaling but it
seems
that .Net (or Mono anyway) doesn't allow to use custom marshaler with
structure (and we need it for virConnectCredential structure). If 
anyone

had
an idea...


Regarding this issue my friend suggested to stop libvirt from taking
ownership of cred.result. We could do that by making
virConnectOpenAuth take a new VIR_CONNECT_COPY_CRED_RESULT (or
VIR_CONNECT_DONT_FREE_CRED_RESULT or VIR_CONNECT_CONST_CRED_RESULT)
flag that lets libvirt internally strdup() cred.result before passing
it to the driver. That way the C# bindings could pass a managed string
as cred.result and we don't need to Marshal.StringToHGlobalAuto() and
strdup in C# at all.

Or we could make libvirt take a custom free function to free
cred.result instead of free(). That way Marshal.FreeHGlobal could be
used or no free function at all and you pass a managed string to it.
This would probably require a new version of virConnectOpenAuth and I
consider this as too invasive.

Another possibility would be to add a public virAlloc to libvirt that
C# can use to allocate memory that can be freed using free().

Matthias






--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

  1   2   >