On Thu, Jan 15, 2026 at 12:03:02PM -0000, [email protected] 
wrote:
> Hi Peter,
> First of all: Thank you for your very elaborate answer! There’s a lot to 
> digest here, and I want to discuss internally with my colleagues how we 
> proceed. I’m pretty sure we will reach out again after we thought through 
> more of the details.
> 
> Peter Krempa wrote:
> > On Mon, Jan 12, 2026 at 14:28:02 -0000,
> > [email protected] wrote:
> > > 2)> If we attach a device  `A` with `--live` and a second device `B` with
> > > `--persistent`, then `A` will not be present in the persistent domain
> > > XML. Still, we expect that `B` is added to both live and persistent
> > > definitions, using the same PCI bus address. By doing so, we would
> > No if you use only --persistent you *must not* touch the live config.
> > This is just a cold-plug request.
> 
> This is one point I would like to discuss further, nevertheless.
> Your statement leaves me a bit confused. The virsh documentation[0]
> says: “For compatibility purposes, --persistent behaves like --config
> for an offline domain, and like --live --config for a running domain. ”
> So wouldn’t it be right, that we *must not* touch the live config if
> the domain is offline, while we *should* indeed touch it when it’s
> online? Or is the documentation outdated here? I would really appreciate
> it if you could clarify.

Note that --persistent is not a concept exposed in the libvirt API,
it is a convenience invented for virsh only.

This is the logic for how --persistent works:

    if (config || persistent)
        flags |= VIR_DOMAIN_AFFECT_CONFIG;
    if (live)
        flags |= VIR_DOMAIN_AFFECT_LIVE;
    if (persistent &&
        virDomainIsActive(dom) == 1)
        flags |= VIR_DOMAIN_AFFECT_LIVE;


IOW,  when --persistent is given, the offline config will always be
updated. If the domain is running, then the live config will also
be updated.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Reply via email to