<div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 28, 2021 at 10:21 PM Daniel P. Berrangé <<a href="mailto:berrange@redhat.com">berrange@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">On Tue, Sep 28, 2021 at 06:14:12PM +0530, Ani Sinha wrote:<br>
> On Tue, Sep 28, 2021 at 17:49 Daniel P. Berrangé <<a href="mailto:berrange@redhat.com" target="_blank">berrange@redhat.com</a>><br>
> wrote:<br>
> <br>
> > 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<br>
> > 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<br>
> > - since<br>
> > > > > we aren't exactly duplicating the QEMU option name anyway, what if<br>
> > 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,<br>
> > 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<br>
> > is<br>
> > > > > right there in the name, and I guess it's *kind of related*<br>
> > (effectively<br>
> > > > > suspending/resuming a single device), so maybe I'm thinking too<br>
> > 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<br>
> > 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<br>
> > existing<br>
> > > > > <acpi> subelement of <features>, which is already used to control<br>
> > whether<br>
> > > > > the guest exposes ACPI to the guest *at all* (via adding "-no-acpi"<br>
> > to the<br>
> > > > > QEMU commandline when <acpi> is missing - NB: this feature flag is<br>
> > currently<br>
> > > > > supported only on x86 and aarch64 QEMU platforms, and ignored for<br>
> > 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<br>
> > "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<br>
> > "disabled". But<br>
> > > > > in the case of these new acpi bridge options we would need to<br>
> > explicitly<br>
> > > > > have the "enabled='yes/no'" rather than just using presence of the<br>
> > 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<br>
> > continue<br>
> > > > > working properly (and identically) with old/existing XML, but if we<br>
> > didn't<br>
> > > > > have an "enabled" attribute for these new flags, there would be no<br>
> > way to<br>
> > > > > tell the difference between "not specified" and "disabled", and so<br>
> > no way to<br>
> > > > > disable the feature for a QEMU where the default was "enabled". (Why<br>
> > does<br>
> > > > > this matter? Because I don't like the inconsistency that would arise<br>
> > from<br>
> > > > > some feature flags using absense to mean "disabled" and some using<br>
> > it to<br>
> > > > > mean "use the default".)<br>
> > > > ><br>
> > > > > * Having something in <features> in the domain XML kind of implies<br>
> > that the<br>
> > > > > associated capability flags should be represented in the <features><br>
> > section<br>
> > > > > of the domain capabilities. For example, <acpi/> is listed under<br>
> > <features><br>
> > > > > in the output of virsh capabilities, separately from the flag<br>
> > 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><br>
> > (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<br>
> <br>
> <br>
> How about <pci-hotplug bridge-acpi='yes/no' /><br>
<br>
Lets actally do<br>
<br>
  <pci acpi-bridge-hotplug="yes|no"/><br>
<br>
so we can put any PCI related global bits here later<br>
</blockquote><div dir="auto"><br></div><div dir="auto">Yes this sounds good.</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><br></blockquote></div></div>