[virt-tools-list] virt-xml/start: Temporarily use another boot configuration

Marc Hartmayer mhartmay at linux.ibm.com
Tue Feb 12 08:46:50 UTC 2019


On Thu, Jan 10, 2019 at 06:42 PM +0100, Cole Robinson <crobinso at redhat.com> wrote:
> On 01/09/2019 06:41 AM, Marc Hartmayer wrote:
>> On Wed, Dec 12, 2018 at 10:16 AM +0100, Marc Hartmayer <mhartmay at linux.ibm.com> wrote:
>>> On Tue, Dec 11, 2018 at 08:22 PM +0100, Cole Robinson <crobinso at redhat.com> wrote:

[…snip…]

>
> No objections, indeed if you want general purpose edit+start then
> extending virt-xml is the place to improve things.
>
> Originally it was a design decision to have virt-xml only operate on
> single blocks of XML classes at a time. This is fixable but things get
> ambiguous. Consider currently editing cpu, you'll do
>
>    virt-xml $VM --edit --cpu FOO

Thanks for the feedback!

How should 'virt-xml $VM --edit target=vda --disk="boot_order=1" --start'
command behave?

 1. only start the domain (=> creation of a transient domain)?
 2. or shall it also define the domain (=> definition + start)?

In case 1, there would already be a way to enforce the definition of
this domain:

virt-xml $VM --edit target=vda --disk="boot_order=1" --start --define

For a start only, in case 2, we have to introduce an additional flag
(e.g. '--no-define') to ensure that no definition takes place (=>
transient domain):

e.g.

virt-xml $VM --edit target=vda --disk="boot_order=1" --start --no-define

Which of these do you prefer?

>
> Okay. If we want to edit clock and cpu, what format do we use?
>
>    virt-xml $VM --edit --cpu FOO --clock BAR   # or
>    virt-xml $VM --edit --cpu FOO --edit --clock BAR

As far as I can see that’s not needed for my use case :)

>
> In that case maybe we could even make --edit optional, but we can't for
> device editing which often requires a value passed to --edit. The
> command line gets a little wonky having to have a matching --edit with
> every XML block. Also even trickier when we get into hotplug operations
> like --attach-device which are inherently serialized operations, if we
> fail half way through a list of hotplug operations the VM is in a weird
> state. But maybe we just disable the multi feature for hotplug operations
>
> Those aren't necessarily blockers but just food for thought.
>
> For the Create handling, it might be as simple as:
>
> dom = <libvirt virDomain>
> guest = virtinst.Guest(parsexml=dom.XMLDesc(...))
> <make your guest edits>
> installer = virtinst.Installer()
> installer.start_install(guest, transient=True)
>
> Thanks,
> Cole
>
--
Kind regards / Beste Grüße
   Marc Hartmayer

IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Matthias Hartmann
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294





More information about the virt-tools-list mailing list