[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [v4][PATCH 12/19] tools/libxl: passes rdm reservation policy
On Tue, Jun 23, 2015 at 10:57 AM, Tiejun Chen <tiejun.chen@xxxxxxxxx> wrote: > This patch passes our rdm reservation policy inside libxl > when we assign a device or attach a device. > > CC: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> > CC: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> > CC: Ian Campbell <ian.campbell@xxxxxxxxxx> > CC: Wei Liu <wei.liu2@xxxxxxxxxx> > Signed-off-by: Tiejun Chen <tiejun.chen@xxxxxxxxx> > --- > v4: > > * Fix one typo, s/unkwon/unknown > * In command description, we should use "[]" to indicate it's optional > for that extended xl command, pci-attach. > > docs/man/xl.pod.1 | 7 ++++++- > tools/libxl/libxl_pci.c | 10 +++++++++- > tools/libxl/xl_cmdimpl.c | 23 +++++++++++++++++++---- > tools/libxl/xl_cmdtable.c | 2 +- > 4 files changed, 35 insertions(+), 7 deletions(-) > > diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1 > index 4eb929d..c5c4809 100644 > --- a/docs/man/xl.pod.1 > +++ b/docs/man/xl.pod.1 > @@ -1368,10 +1368,15 @@ it will also attempt to re-bind the device to its > original driver, making it > usable by Domain 0 again. If the device is not bound to pciback, it will > return success. > > -=item B<pci-attach> I<domain-id> I<BDF> > +=item B<pci-attach> I<domain-id> I<BDF> [I<rdm>] > > Hot-plug a new pass-through pci device to the specified domain. > B<BDF> is the PCI Bus/Device/Function of the physical device to pass-through. > +B<rdm policy> is about how to handle conflict between reserving reserved > device > +memory and guest address space. "strict" means an unsolved conflict leads to > +immediate VM crash, while "relaxed" allows VM moving forward with a warning > +message thrown out. Here "strict" is default. > + > > =item B<pci-detach> [I<-f>] I<domain-id> I<BDF> > > diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c > index a00d799..a6a2a8c 100644 > --- a/tools/libxl/libxl_pci.c > +++ b/tools/libxl/libxl_pci.c > @@ -894,7 +894,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, > libxl_device_pci *pcidev, i > FILE *f; > unsigned long long start, end, flags, size; > int irq, i, rc, hvm = 0; > - uint32_t flag = XEN_DOMCTL_DEV_RDM_RELAXED; > + uint32_t flag; > > if (type == LIBXL_DOMAIN_TYPE_INVALID) > return ERROR_FAIL; > @@ -988,6 +988,14 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, > libxl_device_pci *pcidev, i > > out: > if (!libxl_is_stubdom(ctx, domid, NULL)) { > + if (pcidev->rdm_reserve == LIBXL_RDM_RESERVE_FLAG_RELAXED) { > + flag = XEN_DOMCTL_DEV_RDM_RELAXED; > + } else if (pcidev->rdm_reserve == LIBXL_RDM_RESERVE_FLAG_STRICT) { > + flag = XEN_DOMCTL_DEV_RDM_STRICT; > + } else { > + LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unknown rdm check > flag."); > + return ERROR_FAIL; > + } Shouldn't this be in the previous patch? -George _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |