Re: [libvirt-users] Libvirt API for attaching volume to domain

2019-08-15 Thread Peter Krempa

[Please don't top-post on technical lists.]

On Wed, Aug 14, 2019 at 19:43:11 +0530, Varsha Verma wrote:
> Thanks, this is exactly what I needed.
> 
> Is there some documentation where I can get how to exactly call this
> function along with the arguments?

python has builtin documentation:

import libvirt
help(libvirt)

Disk XML documentation is here:
https://libvirt.org/formatdomain.html#elementsDisks

the C api documentation is here:
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainAttachDeviceFlags

Also for inspiration 'virsh attach-disk' supports the --print-xml
argument.


signature.asc
Description: PGP signature
___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users

Re: [libvirt-users] Libvirt API for attaching volume to domain

2019-08-14 Thread Christian Kujau
On Wed, 14 Aug 2019, Varsha Verma wrote:
> Is there some documentation where I can get how to exactly call this
> function along with the arguments?

Documentation to various language bindings can be found here:

 https://libvirt.org/bindings.html

HTH,
C.
-- 
BOFH excuse #417:

Computer room being moved.  Our systems are down for the weekend.

___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users


Re: [libvirt-users] Libvirt API for attaching volume to domain

2019-08-14 Thread Varsha Verma
Thanks, this is exactly what I needed.

Is there some documentation where I can get how to exactly call this
function along with the arguments?




On Wed, Aug 14, 2019 at 6:48 PM Peter Krempa  wrote:

> On Wed, Aug 14, 2019 at 18:23:30 +0530, Varsha Verma wrote:
> > Hi,
> >
> > I wanted to know if there is any Python API exposed for libvirt using
> which
> > I can attach a libvirt volume to a libvirt domain/VM.
> >
> > I intend to do something similar to the `attach-disk` command of virsh
> > using python.
>
> virsh uses the virDomainAttachDeviceFlags API in the 'attach-disk'
> command wrapper. the python bindings expose it as 'attachDeviceFlags'
> method of the virDomain class.
>


-- 

*Regards,*

*Varsha Verma*

*Third Year Undergraduate*

*Department of Electrical Engineering*

*IIT-BHU, Varanasi*
___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users

Re: [libvirt-users] Libvirt API for attaching volume to domain

2019-08-14 Thread Peter Krempa
On Wed, Aug 14, 2019 at 18:23:30 +0530, Varsha Verma wrote:
> Hi,
> 
> I wanted to know if there is any Python API exposed for libvirt using which
> I can attach a libvirt volume to a libvirt domain/VM.
> 
> I intend to do something similar to the `attach-disk` command of virsh
> using python.

virsh uses the virDomainAttachDeviceFlags API in the 'attach-disk'
command wrapper. the python bindings expose it as 'attachDeviceFlags'
method of the virDomain class.


signature.asc
Description: PGP signature
___
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users