[libvirt] libvirt API to write sectors on a device

Hello,***I am able to compile libvirt samples on my KVM hypervisor. (I edited and recompiled info.c code) *I am creating a sample code to read/write disk devices. With method *virDomainBlockPeek I can** read sectors from a given device attached to a KVM virtual guest.**I am not able to* find an API to write sectors on a disk: am I missing something ?Is there such method to write sectors from a given virtual disk ? Thanks,Francesco

On Tue, May 19, 2009 at 02:39:04PM +0200, Francesco Latino wrote:
Hello,***I am able to compile libvirt samples on my KVM hypervisor. (I edited and recompiled info.c code) *I am creating a sample code to read/write disk devices. With method *virDomainBlockPeek I can** read sectors from a given device attached to a KVM virtual guest.**I am not able to* find an API to write sectors on a disk: am I missing something ?Is there such method to write sectors from a given virtual disk ?
Hum, right, there is only read-only support since that's what was needed at the time. I'm not sure we should add unstructured write support like this, I don't know what you're trying to achieve but maybe libguestfs would be a better fit, have a look ! http://et.redhat.com/~rjones/libguestfs/ Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

Great ! Thanks a lot ! On Tue, May 19, 2009 at 2:50 PM, Daniel Veillard <veillard@redhat.com>wrote:
On Tue, May 19, 2009 at 02:39:04PM +0200, Francesco Latino wrote:
Hello,***I am able to compile libvirt samples on my KVM hypervisor. (I edited and recompiled info.c code) *I am creating a sample code to read/write disk devices. With method *virDomainBlockPeek I can** read sectors from a given device attached to a KVM virtual guest.**I am not able to* find an API to write sectors on a disk: am I missing something ?Is there such method to write sectors from a given virtual disk ?
Hum, right, there is only read-only support since that's what was needed at the time. I'm not sure we should add unstructured write support like this, I don't know what you're trying to achieve but maybe libguestfs would be a better fit, have a look !
http://et.redhat.com/~rjones/libguestfs/<http://et.redhat.com/%7Erjones/libguestfs/>
Daniel
-- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (2)
-
Daniel Veillard
-
Francesco Latino