rgbkrk / libvirt-go

[DEPRECATED] Go bindings for libvirt
https://github.com/libvirt/libvirt-go
MIT License
166 stars 50 forks source link

Start inactive domain #108

Closed michaeljs1990 closed 7 years ago

michaeljs1990 commented 8 years ago

I must be blind but can't figure out how to do run virsh start some_domain from these bindings.

vincentbernat commented 8 years ago

Retrieve the domain with whatever method you want, then use Create() or CreateWithFlags().

michaeljs1990 commented 8 years ago

awesome, thanks. I did indeed see that but through that because virsh create inactive-domain from the cli on an inactive domain throws an error it would have the same functionality.

mraygalaxy commented 7 years ago

@michaeljs1990 That's a good point. The naming looks to be wrong. Any chance you could make a PR with the right name? (Maybe don't phase out the old name, or just deprecated it) so that the names properly match up with the libvirt API?

vincentbernat commented 7 years ago

virsh start uses virDomainCreateWithFlags() and virDomainCreate(). virsh create expects an XML file for domain creation (and uses virDomainCreateXML().

mraygalaxy commented 7 years ago

Aha, so it's named appropriately according to the API, not the command line. So we're doing the right thing. Thanks for the clarification =)