[libvirt] Out of Memory Error

Hi, I am trying to attach a usb device to my virtualbox node using libvirt. My node is already running, I stop my node and then I am trying to add this usb device. I have a separate xml file defined for usb. It looks like this: *<device> <hostdev mode='subsystem' type='usb'> <source> <vendor id='0x4321'/> <product id='0xfeeb'/> </source> </hostdev> </device> * * * I am trying to attach it using code: *conn = libvirt.open("vbox:///session") if conn ==None: print 'Failed to open connection to the hypervisor' sys.exit(1) print 'connected to vbox hypervisor driver' domainInstance = conn.lookupByName('SampleNode') filed = open('/root/testFolder/usbSharedFolder.xml', 'r') config_str = filed.read() libvirt.virDomain.attachDevice(domainInstance, config_str)* When it is executed I am getting an error message saying: *libvir: VirtualBox Driver error : out of memory * * * Even with virsh it is giving the same error. I am using the below command: *attach-device SampleNode /root/testFolder/usbSharedFolder.xml* Can anyone tell me what is going wrong. It is really very important. Please do reply. Thanks in advance.

Hi, Today I noticed one strange thing. I* *removed the contents of *usbSharedFolder.xml *and kept it blank. Then I again tried both ways i.e. calling attachDevice method using code as well as virsh but again it gave libvir: VirtualBox Driver error : out of memory but I was expecting some syntactical error. Is this a bug....?? And if it is a bug can anyone release a patch for this....?? On Tue, Feb 12, 2013 at 9:17 PM, varun bhatnagar <varun292006@gmail.com>wrote:
Hi,
I am trying to attach a usb device to my virtualbox node using libvirt. My node is already running, I stop my node and then I am trying to add this usb device. I have a separate xml file defined for usb. It looks like this:
*<device> <hostdev mode='subsystem' type='usb'> <source> <vendor id='0x4321'/> <product id='0xfeeb'/> </source> </hostdev> </device> * * * I am trying to attach it using code:
*conn = libvirt.open("vbox:///session") if conn ==None: print 'Failed to open connection to the hypervisor' sys.exit(1) print 'connected to vbox hypervisor driver' domainInstance = conn.lookupByName('SampleNode') filed = open('/root/testFolder/usbSharedFolder.xml', 'r') config_str = filed.read() libvirt.virDomain.attachDevice(domainInstance, config_str)*
When it is executed I am getting an error message saying: *libvir: VirtualBox Driver error : out of memory * * * Even with virsh it is giving the same error. I am using the below command: *attach-device SampleNode /root/testFolder/usbSharedFolder.xml*
Can anyone tell me what is going wrong. It is really very important. Please do reply. Thanks in advance.

On Thu, Feb 14, 2013 at 01:24:32 +0530, varun bhatnagar wrote:
Hi,
Today I noticed one strange thing. I* *removed the contents of *usbSharedFolder.xml *and kept it blank. Then I again tried both ways i.e. calling attachDevice method using code as well as virsh but again it gave libvir: VirtualBox Driver error : out of memory but I was expecting some syntactical error. Is this a bug....??
Yes, it's a bug. See http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=2e5d7798df56621986bddd5... for the patch that is now in libvirt git repository.
I am trying to attach a usb device to my virtualbox node using libvirt. My node is already running, I stop my node and then I am trying to add this usb device. I have a separate xml file defined for usb. It looks like this:
*<device> <hostdev mode='subsystem' type='usb'> <source> <vendor id='0x4321'/> <product id='0xfeeb'/> </source> </hostdev> </device> *
Btw, this XML is not correct. It should contain just the <hostdev> element. Jirka

Thank you so much for the reply and for sharing the patch...I will try this tomorrow and then let you know whether it works or not.....And i'll try removing the <device> tag too..... Thank you again for the help.... :) On Thu, Feb 14, 2013 at 2:11 PM, Jiri Denemark <jdenemar@redhat.com> wrote:
On Thu, Feb 14, 2013 at 01:24:32 +0530, varun bhatnagar wrote:
Hi,
Today I noticed one strange thing. I* *removed the contents of *usbSharedFolder.xml *and kept it blank. Then I again tried both ways i.e. calling attachDevice method using code as well as virsh but again it gave libvir: VirtualBox Driver error : out of memory but I was expecting some syntactical error. Is this a bug....??
Yes, it's a bug. See
http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=2e5d7798df56621986bddd5... for the patch that is now in libvirt git repository.
I am trying to attach a usb device to my virtualbox node using libvirt. My node is already running, I stop my node and then I am trying to add this usb device. I have a separate xml file defined for usb. It looks like this:
*<device> <hostdev mode='subsystem' type='usb'> <source> <vendor id='0x4321'/> <product id='0xfeeb'/> </source> </hostdev> </device> *
Btw, this XML is not correct. It should contain just the <hostdev> element.
Jirka

Hi, The mentioned changes worked for adding a shared folder but while adding usb it gave an error saying: *error: Failed to attach device from /root/test/addingusb.xml error: An error occurred, but the cause is unknown* The xml file is given below: <hostdev mode='subsystem' type='usb'> <source> <vendor id='0x4321'/> <product id='0xfeeb'/> </source> </hostdev> Can you tell me what shall I do remove this error? On Fri, Feb 15, 2013 at 12:28 AM, varun bhatnagar <varun292006@gmail.com>wrote:
Thank you so much for the reply and for sharing the patch...I will try this tomorrow and then let you know whether it works or not.....And i'll try removing the <device> tag too..... Thank you again for the help.... :)
On Thu, Feb 14, 2013 at 2:11 PM, Jiri Denemark <jdenemar@redhat.com>wrote:
On Thu, Feb 14, 2013 at 01:24:32 +0530, varun bhatnagar wrote:
Hi,
Today I noticed one strange thing. I* *removed the contents of *usbSharedFolder.xml *and kept it blank. Then I again tried both ways i.e. calling attachDevice method using code as well as virsh but again it gave libvir: VirtualBox Driver error : out of memory but I was expecting some syntactical error. Is this a bug....??
Yes, it's a bug. See
http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=2e5d7798df56621986bddd5... for the patch that is now in libvirt git repository.
I am trying to attach a usb device to my virtualbox node using libvirt. My node is already running, I stop my node and then I am trying to add this usb device. I have a separate xml file defined for usb. It looks like this:
*<device> <hostdev mode='subsystem' type='usb'> <source> <vendor id='0x4321'/> <product id='0xfeeb'/> </source> </hostdev> </device> *
Btw, this XML is not correct. It should contain just the <hostdev> element.
Jirka
participants (2)
-
Jiri Denemark
-
varun bhatnagar