On 12/15/2015 04:36 AM, Andrei
Perietanu wrote:
Tanks for the reply Eric.
The only reason I'm not going
through the API is because there is nothing in the API
(AFIK), that will allow you to modify the VNC settings, i.e.
enable/disable, change port number. So I figured, the only
way to do it is to modify the XML.
I
can't use virsh edit because I need this whole behavior
scripted.
So now if I want to change
the VNC settings it looks like I have to read the XML,
modify it, define it, actually re-define it (maybe I have to
undefine it first?! ) and that's it - correct?
If you
"define" a domain that already exists, the new definition
replaces the existing one, but not until the domain has been
powered off - the next time it is started, the new config takes
effect. There is no need to "undefine" or separately
"re-define".
So the solution to your problem is to simply replace the final
two lines of your example code (open() and f.write()) with
Eric's suggested line:
vm.defineXML(xml)
That's it.
(BTW, please make your replies inline rather that top-posting.
It makes it much easier to follow the discussion)
The
information
transmitted is intended only for the person or entity to which
it is
addressed and may contain confidential and/or privileged
material.
Any review, retransmission, dissemination or other use of or
taking
of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. If
you
receive this in error please contact the sender and delete the
material from any computer immediately. It is the policy of
Klas
Limited to disavow the sending of offensive material and
should
you consider that the material contained in the message is
offensive
you should contact the sender immediately and also your I.T.
Manager.
Klas Telecom
Inc., a Virginia Corporation with offices at 1101 30th St. NW,
Washington, DC 20007.
Klas
Limited
(Company Number 163303) trading as Klas Telecom, an Irish
Limited
Liability Company, with its registered office at Fourth
Floor, One
Kilmainham Square, Inchicore Road, Kilmainham, Dublin 8,
Ireland.
_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users
|
_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users