<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>On Dec 24, 2013, at 2:13 AM, Umar Draz <<a href="mailto:unix.co@gmail.com">unix.co@gmail.com</a>> wrote:</div><div><br></div><blockquote type="cite"><div><div dir="ltr"><div>Hi</div><div><br></div><div>I am trying to set Metada of running virtual machine, but its giving me an error.</div></div></div></blockquote><div><br></div>Thanks for taking the time to report a potential issue. When you report potential issues please make sure to include the version of libvirt you are using. <br><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>Here is my code</div><div><br></div><div><div>import libvirt</div><div>
<br></div><div>conn = libvirt.open('qemu+tcp://<a href="http://10.0.128.12/system">10.0.128.12/system</a>')</div><div>dom = conn.lookupByName('virtspace')</div><div>type = 'VIR_DOMAIN_METADATA_DESCRIPTION'</div></div></div></div></blockquote><div><br></div>The type value is not a string, it should be libvirt.VIR_DOMAIN_METADATA_DESCRIPTION<br><blockquote type="cite"><div><div dir="ltr"><div>
<div>key = ''</div><div>uri = ''</div></div></div></div></blockquote><div><br></div>The above values must be set to None for when setting the description per the documentation.<br><blockquote type="cite"><div><div dir="ltr"><div><div><br></div><div>dom.setMetadata(conn, type, 'myDescription', key, uri)</div></div><div><br></div><div><br></div><div>and here is the error.</div><div><br></div>
<div>Traceback (most recent call last):</div><div>  File "setMeta.py", line 11, in <module></div><div>    dom.setMetadata(conn, type, 'meta_test', key, uri)</div><div>  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 1460, in setMetadata</div>
<div>    ret = libvirtmod.virDomainSetMetadata(self._o, type, metadata, key, uri, flags)</div><div>AttributeError: virConnect instance has no attribute '__trunc__'</div></div></div></blockquote><div><br></div>Definitely curious what version you used since we should not error like this despite the argument mix up.<div><blockquote type="cite"><div><div dir="ltr"><div><br></div></div>
</div></blockquote><blockquote type="cite"><div><span>--</span><br><span>libvir-list mailing list</span><br><span><a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a></span><br><span><a href="https://www.redhat.com/mailman/listinfo/libvir-list">https://www.redhat.com/mailman/listinfo/libvir-list</a></span></div></blockquote></div></body></html>