<div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 28, 2021 at 17:49 Daniel P. Berrangé <<a href="mailto:berrange@redhat.com">berrange@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Sep 28, 2021 at 05:31:43PM +0530, Ani Sinha wrote:<br>
> <br>
> <br>
> On Tue, 28 Sep 2021, Daniel P. Berrangé wrote:<br>
> <br>
> > On Thu, Sep 23, 2021 at 04:46:38PM -0400, Laine Stump wrote:<br>
> > > On 9/11/21 11:26 PM, Ani Sinha wrote:<br>
> > > > Hi all:<br>
> > > ><br>
> > > > This patchset introduces libvirt xml support for the following two pm conf<br>
> > > > options:<br>
> > > ><br>
> > > > <pm><br>
> > > >    <acpi-hotplug-bridge enabled='no'/><br>
> > > >    <acpi-root-hotplug enabled='yes'/><br>
> > > > </pm><br>
> > ><br>
> > > (before I get into a more radical discussion about different options - since<br>
> > > we aren't exactly duplicating the QEMU option name anyway, what if we made<br>
> > > these names more consistent, e.g. "acpi-hotplug-bridge" and<br>
> > > "acpi-hotplug-root"?)<br>
> > ><br>
> > > I've thought quite a bit about whether to put these attributes here, or<br>
> > > somewhere else, and I'm still undecided.<br>
> > ><br>
> > > My initial reaction to this was "PM == Power Management, and power<br>
> > > management is all about suspend mode support. Hotplug isn't power<br>
> > > management." But then you look at the name of the QEMU option and PM is<br>
> > > right there in the name, and I guess it's *kind of related* (effectively<br>
> > > suspending/resuming a single device), so maybe I'm thinking too narrowly.<br>
> ><br>
> > I had the same reaction.  Even if QEMU hangs it off a "_PM" device,<br>
> > I feel it is a pretty wierd location from libvirt POV to put this.<br>
> ><br>
> > > So are there alternate places that might fit the purpose of these new<br>
> > > options better, rather than directly mimicking the QEMU option placement<br>
> > > (for better or worse)? A couple alternative possibilities:<br>
> > ><br>
> > > 1) ****<br>
> > ><br>
> > > One possibility would be to include these new flags within the existing<br>
> > > <acpi> subelement of <features>, which is already used to control whether<br>
> > > the guest exposes ACPI to the guest *at all* (via adding "-no-acpi" to the<br>
> > > QEMU commandline when <acpi> is missing - NB: this feature flag is currently<br>
> > > supported only on x86 and aarch64 QEMU platforms, and ignored for all other<br>
> > > hypervisors).<br>
> > ><br>
> > > Possibly the new flags could be put in something like this:<br>
> > ><br>
> > > <features><br>
> > >   <acpi><br>
> > >     <hotplug-bridge enabled='no'/><br>
> > >     <hotplug-root enabled='yes'/><br>
> > >   </acpi><br>
> > >   ...<br>
> > > </features><br>
> > ><br>
> > > But:<br>
> > ><br>
> > > * currently there are no subelements to <acpi>. So this isn't "extending<br>
> > > according to an existing pattern".<br>
> > ><br>
> > > * even though the <features> element uses presence of a subelement to<br>
> > > indicate "enabled" and absence of the subelement to indicate "disabled". But<br>
> > > in the case of these new acpi bridge options we would need to explicitly<br>
> > > have the "enabled='yes/no'" rather than just using presence of the option to<br>
> > > mean "enabled" and absence to mean "disabled" because the default for<br>
> > > "root-hotplug" up until now has been *enabled*, and the default for<br>
> > > hotplug-bridge is different depending on machinetype. We need to continue<br>
> > > working properly (and identically) with old/existing XML, but if we didn't<br>
> > > have an "enabled" attribute for these new flags, there would be no way to<br>
> > > tell the difference between "not specified" and "disabled", and so no way to<br>
> > > disable the feature for a QEMU where the default was "enabled". (Why does<br>
> > > this matter? Because I don't like the inconsistency that would arise from<br>
> > > some feature flags using absense to mean "disabled" and some using it to<br>
> > > mean "use the default".)<br>
> > ><br>
> > > * Having something in <features> in the domain XML kind of implies that the<br>
> > > associated capability flags should be represented in the <features> section<br>
> > > of the domain capabilities. For example, <acpi/> is listed under <features><br>
> > > in the output of virsh capabilities, separately from the flag indicating<br>
> > > presence of the -no-acpi option. I'm not sure if we would need to add<br>
> > > something there for these options if we moved them into <features> (seems a<br>
> > > bit redundant to me to have it in both places, but I'm sure there are<br>
> > > $reasons).<br>
> ><br>
> > Essentially <features> has become a dumping ground for adhoc global<br>
> > properties. So in that sense it probably is the best fit for this.<br>
> ><br>
> > If we don't want to touch th existing <acpi> element for fear of<br>
> > back compat issues, we could have<br>
> ><br>
> >    <pci-hotplug acpi="yes|no"/><br>
> ><br>
> > for the acpi-pci-hotplug-with-bridge-support   setting ?<br>
> ><br>
> <br>
> Since this is pci bridge related setting, maybe we should have:<br>
> <br>
> <pci-hotplug-bridge acpi="yes|no"/><br>
> <br>
> Although in that case, the user should be aware that pcie-root-ports are<br>
> like bridges. But if we do not have -bridge, then it does not convey the<br>
> fact that this setting does not apply to pci-root bus on i440fx. :-\<br>
<br>
I thought without -bridge is better, because we might want to hang<br>
more PCI hotplug options off it later. The docs can clarify the<br>
semantics</blockquote><div dir="auto"><br></div><div dir="auto">How about <pci-hotplug bridge-acpi='yes/no' /></div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" dir="auto"><br>
<br>
<br>
Regards,<br>
Daniel<br>
-- <br>
|: <a href="https://berrange.com" rel="noreferrer" target="_blank">https://berrange.com</a>      -o-    <a href="https://www.flickr.com/photos/dberrange" rel="noreferrer" target="_blank">https://www.flickr.com/photos/dberrange</a> :|<br>
|: <a href="https://libvirt.org" rel="noreferrer" target="_blank">https://libvirt.org</a>         -o-            <a href="https://fstop138.berrange.com" rel="noreferrer" target="_blank">https://fstop138.berrange.com</a> :|<br>
|: <a href="https://entangle-photo.org" rel="noreferrer" target="_blank">https://entangle-photo.org</a>    -o-    <a href="https://www.instagram.com/dberrange" rel="noreferrer" target="_blank">https://www.instagram.com/dberrange</a> :|<br>
<br>
</blockquote></div></div>