* [PATCH] libxl: Fix vcpu-set for PV guest.
@ 2014-01-31 16:35 Anthony PERARD
2014-02-04 14:46 ` Ian Campbell
0 siblings, 1 reply; 4+ messages in thread
From: Anthony PERARD @ 2014-01-31 16:35 UTC (permalink / raw)
To: Xen Devel; +Cc: Anthony PERARD, Ian Campbell, Yun Wang
vcpu-set will try to use the HVM path (through QEMU) instead of the PV
path (through xenstore) for a PV guest, if there is a QEMU running for
this domain. This patch check which kind of guest is running before
before doing any call.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
Yun, is this patch fix the issue with your PV guest ?
tools/libxl/libxl.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 2845ca4..c4fe6af 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4692,12 +4692,21 @@ int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap)
{
GC_INIT(ctx);
int rc;
- switch (libxl__device_model_version_running(gc, domid)) {
- case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
- rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap);
+ switch (libxl__domain_type(gc, domid)) {
+ case LIBXL_DOMAIN_TYPE_HVM:
+ switch (libxl__device_model_version_running(gc, domid)) {
+ case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
+ rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap);
+ break;
+ case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
+ rc = libxl__set_vcpuonline_qmp(gc, domid, cpumap);
+ break;
+ default:
+ rc = ERROR_INVAL;
+ }
break;
- case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
- rc = libxl__set_vcpuonline_qmp(gc, domid, cpumap);
+ case LIBXL_DOMAIN_TYPE_PV:
+ rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap);
break;
default:
rc = ERROR_INVAL;
--
Anthony PERARD
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] libxl: Fix vcpu-set for PV guest.
2014-01-31 16:35 [PATCH] libxl: Fix vcpu-set for PV guest Anthony PERARD
@ 2014-02-04 14:46 ` Ian Campbell
2014-02-05 10:43 ` George Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2014-02-04 14:46 UTC (permalink / raw)
To: Anthony PERARD; +Cc: George Dunlap, Yun Wang, Xen Devel
On Fri, 2014-01-31 at 16:35 +0000, Anthony PERARD wrote:
> vcpu-set will try to use the HVM path (through QEMU) instead of the PV
> path (through xenstore) for a PV guest, if there is a QEMU running for
> this domain. This patch check which kind of guest is running before
> before doing any call.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
> ---
>
> Yun, is this patch fix the issue with your PV guest ?
Yun, any feedback on this patch?
George -- I think vcpu-set not working for PV guests is a bug worth
fixing in 4.4 so I intend to apply.
>
>
> tools/libxl/libxl.c | 19 ++++++++++++++-----
> 1 file changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 2845ca4..c4fe6af 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -4692,12 +4692,21 @@ int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap)
> {
> GC_INIT(ctx);
> int rc;
> - switch (libxl__device_model_version_running(gc, domid)) {
> - case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
> - rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap);
> + switch (libxl__domain_type(gc, domid)) {
> + case LIBXL_DOMAIN_TYPE_HVM:
> + switch (libxl__device_model_version_running(gc, domid)) {
> + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
> + rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap);
> + break;
> + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
> + rc = libxl__set_vcpuonline_qmp(gc, domid, cpumap);
> + break;
> + default:
> + rc = ERROR_INVAL;
> + }
> break;
> - case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
> - rc = libxl__set_vcpuonline_qmp(gc, domid, cpumap);
> + case LIBXL_DOMAIN_TYPE_PV:
> + rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap);
> break;
> default:
> rc = ERROR_INVAL;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] libxl: Fix vcpu-set for PV guest.
2014-02-04 14:46 ` Ian Campbell
@ 2014-02-05 10:43 ` George Dunlap
2014-02-06 12:40 ` Ian Campbell
0 siblings, 1 reply; 4+ messages in thread
From: George Dunlap @ 2014-02-05 10:43 UTC (permalink / raw)
To: Ian Campbell, Anthony PERARD; +Cc: Yun Wang, Xen Devel
On 02/04/2014 02:46 PM, Ian Campbell wrote:
> On Fri, 2014-01-31 at 16:35 +0000, Anthony PERARD wrote:
>> vcpu-set will try to use the HVM path (through QEMU) instead of the PV
>> path (through xenstore) for a PV guest, if there is a QEMU running for
>> this domain. This patch check which kind of guest is running before
>> before doing any call.
>>
>> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
>
>> ---
>>
>> Yun, is this patch fix the issue with your PV guest ?
> Yun, any feedback on this patch?
>
> George -- I think vcpu-set not working for PV guests is a bug worth
> fixing in 4.4 so I intend to apply.
Yes, please do.
-George
>
>>
>> tools/libxl/libxl.c | 19 ++++++++++++++-----
>> 1 file changed, 14 insertions(+), 5 deletions(-)
>>
>> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
>> index 2845ca4..c4fe6af 100644
>> --- a/tools/libxl/libxl.c
>> +++ b/tools/libxl/libxl.c
>> @@ -4692,12 +4692,21 @@ int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap)
>> {
>> GC_INIT(ctx);
>> int rc;
>> - switch (libxl__device_model_version_running(gc, domid)) {
>> - case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
>> - rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap);
>> + switch (libxl__domain_type(gc, domid)) {
>> + case LIBXL_DOMAIN_TYPE_HVM:
>> + switch (libxl__device_model_version_running(gc, domid)) {
>> + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
>> + rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap);
>> + break;
>> + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
>> + rc = libxl__set_vcpuonline_qmp(gc, domid, cpumap);
>> + break;
>> + default:
>> + rc = ERROR_INVAL;
>> + }
>> break;
>> - case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
>> - rc = libxl__set_vcpuonline_qmp(gc, domid, cpumap);
>> + case LIBXL_DOMAIN_TYPE_PV:
>> + rc = libxl__set_vcpuonline_xenstore(gc, domid, cpumap);
>> break;
>> default:
>> rc = ERROR_INVAL;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] libxl: Fix vcpu-set for PV guest.
2014-02-05 10:43 ` George Dunlap
@ 2014-02-06 12:40 ` Ian Campbell
0 siblings, 0 replies; 4+ messages in thread
From: Ian Campbell @ 2014-02-06 12:40 UTC (permalink / raw)
To: George Dunlap; +Cc: Anthony PERARD, Yun Wang, Xen Devel
On Wed, 2014-02-05 at 10:43 +0000, George Dunlap wrote:
> On 02/04/2014 02:46 PM, Ian Campbell wrote:
> > On Fri, 2014-01-31 at 16:35 +0000, Anthony PERARD wrote:
> >> vcpu-set will try to use the HVM path (through QEMU) instead of the PV
> >> path (through xenstore) for a PV guest, if there is a QEMU running for
> >> this domain. This patch check which kind of guest is running before
> >> before doing any call.
> >>
> >> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> > Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >
> >> ---
> >>
> >> Yun, is this patch fix the issue with your PV guest ?
> > Yun, any feedback on this patch?
> >
> > George -- I think vcpu-set not working for PV guests is a bug worth
> > fixing in 4.4 so I intend to apply.
>
> Yes, please do.
Done. Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-02-06 12:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-31 16:35 [PATCH] libxl: Fix vcpu-set for PV guest Anthony PERARD
2014-02-04 14:46 ` Ian Campbell
2014-02-05 10:43 ` George Dunlap
2014-02-06 12:40 ` Ian Campbell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).