libxl: use qemu-xen (upstream QEMU) as device model by default
PATCH v2 1/1 libxl: use qemu-xen (upstream QEMU) as device model by default
Changes in v2:
- update the xl man page;
- write a small helper function in libxl_{linux,netbsd}.c to set the default device_model, so that NetBSD can keep using the old version.
docs/man/xl.cfg.pod.5 +6 -6
@@ -1132,15 +1132,15 @@ guest. Valid values are: =over 4 -=item B<qemu-xen-traditional> +=item B<qemu-xen> -Use the device-model based upon the historical Xen fork of Qemu. This -device-model is currently the default. +use the device-model merged into the upstream QEMU project. +This device-model is the default for Linux dom0. -=item B<qemu-xen> +=item B<qemu-xen-traditional> -use the device-model merged into the upstream QEMU project. This -device-model will become the default in a future version of Xen. +Use the device-model based upon the historical Xen fork of Qemu. +This device-model is still the default for NetBSD dom0. =back
tools/libxl/libxl_create.c +1 -2
@@ -143,8 +143,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,if (!b_info->device_model_version) {if (b_info->type ==LIBXL_DOMAIN_TYPE_HVM ) - b_info->device_model_version = -LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL ; + b_info->device_model_version =libxl__default_device_model (gc);else {const char *dm;int rc;
tools/libxl/libxl_internal.h +4 -0
@@ -1557,6 +1557,10 @@ _hidden libxl__json_object *libxl__json_parse(libxl__gc *gc_opt, const char *s);/* Based on /local/domain/$domid/dm-version xenstore key * default is qemu xen traditional */ _hidden int libxl__device_model_version_running(libxl__gc *gc, uint32_t domid); +/* Return the system-wide default device model: +* qemu-xen for Linux, qemu-xen-traditional for NetBSD. +*/ +_hidden libxl_device_model_version libxl__default_device_model(libxl__gc *gc);/* Check how executes hotplug script currently */ int libxl__hotplug_settings (libxl__gc *gc,xs_transaction_t t);
tools/libxl/libxl_linux.c +5 -0
@@ -266,3 +266,8 @@ int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev, out:return rc; } + +libxl_device_model_version libxl__default_device_model (libxl__gc *gc) +{ +return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN ; +}
tools/libxl/libxl_netbsd.c +5 -0
@@ -94,3 +94,8 @@ int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev, out:return rc; } + +libxl_device_model_version libxl__default_device_model (libxl__gc *gc) +{ +return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL ; +}
Quoted 5 lines · Stefano Stabellini
docs/man/xl.cfg.pod.5 +0
-0
docs/man/xl.cfg.pod.5 guest. Valid values are: · line 1137
Quoted 9 lines
docs/man/xl.cfg.pod.5 +2
-3@@ -1132,15 +1132,15 @@ guest. Valid values are: =over 4 -=item B<qemu-xen-traditional> +=item B<qemu-xen> -Use the device-model based upon the historical Xen fork of Qemu. This -device-model is currently the default. +use the device-model merged into the upstream QEMU project.
Can you correct to "Use" as you move it please.
docs/man/xl.cfg.pod.5 guest. Valid values are: · line 1143
Quoted 9 lines
docs/man/xl.cfg.pod.5 +4
-3+This device-model is the default for Linux dom0. -=item B<qemu-xen> +=item B<qemu-xen-traditional> -use the device-model merged into the upstream QEMU project. This -device-model will become the default in a future version of Xen. +Use the device-model based upon the historical Xen fork of Qemu. +This device-model is still the default for NetBSD dom0.
Does that look like changing for 4.3?
tools/libxl/libxl_create.c int libxl__domain_build_info_setdefault(libxl__gc *gc, · line 146
Quoted 11 lines
tools/libxl/libxl_create.c +1
-2@@ -143,8 +143,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,if (!b_info->device_model_version) {if (b_info->type ==LIBXL_DOMAIN_TYPE_HVM ) - b_info->device_model_version = -LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL ; + b_info->device_model_version =libxl__default_device_model (gc);
For PV we stat() the executable before using it -- I don't remember why but should we be doing the same here?
Also, will this not break things for people with "device_model_stubdomain_override = 1" (but nothing else) in their configuration?
I think the logic needs to be (perhaps in Linux'slibxl__default_device_model(gc) only)
if (libxl_defbool_val(b_info->device_model_stubdomain) LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL; else LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
? At least until we have upstream stubdoms in some form.
tools/libxl/libxl_internal.h _hidden libxl__json_object *libxl__json_parse(libxl__gc *gc_opt, const char *s); · line 1561
Quoted 13 lines
tools/libxl/libxl_create.c +0
-0else {const char *dm;int rc;tools/libxl/libxl_internal.h +2
-0@@ -1557,6 +1557,10 @@ _hidden libxl__json_object *libxl__json_parse(libxl__gc *gc_opt, const char *s);/* Based on /local/domain/$domid/dm-version xenstore key * default is qemu xen traditional */ _hidden int libxl__device_model_version_running(libxl__gc *gc, uint32_t domid); +/* Return the system-wide default device model: +* qemu-xen for Linux, qemu-xen-traditional for NetBSD.
I bet you someone forgets to update this when NetBSD changes ;-)
Quoted 5 lines
tools/libxl/libxl_internal.h +2
-0+*/ +_hidden libxl_device_model_version libxl__default_device_model(libxl__gc *gc);/* Check how executes hotplug script currently */ int libxl__hotplug_settings (libxl__gc *gc,xs_transaction_t t);
v3 cover libxl: change to qemu-xen (upstream) by default
Ian Campbell writes ("Re: [Xen-devel] [PATCH v2] libxl: use qemu-xen (upstream QEMU) as device model by default"):
Quoted 6 lines · Stefano Stabellini
docs/man/xl.cfg.pod.5 guest. Valid values are: · line 1137
Quoted 3 lines
docs/man/xl.cfg.pod.5 +1
-2-Use the device-model based upon the historical Xen fork of Qemu. This -device-model is currently the default. +use the device-model merged into the upstream QEMU project.Can you correct to "Use" as you move it please.
Fixed.
Quoted 6 lines
docs/man/xl.cfg.pod.5 guest. Valid values are: · line 1143
Quoted 4 lines
docs/man/xl.cfg.pod.5 +2
-2-use the device-model merged into the upstream QEMU project. This -device-model will become the default in a future version of Xen. +Use the device-model based upon the historical Xen fork of Qemu. +This device-model is still the default for NetBSD dom0.Does that look like changing for 4.3?
I guess not but I don't think that should block this change.
Quoted 6 lines
tools/libxl/libxl_create.c int libxl__domain_build_info_setdefault(libxl__gc *gc, · line 146
Quoted 3 lines
tools/libxl/libxl_create.c +1
-2- b_info->device_model_version = -LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL ; + b_info->device_model_version =libxl__default_device_model (gc);For PV we
stat()the executable before using it -- I don't remember why but should we be doing the same here?
Presumably in case the upstream build was disabled. I think the same logic applies so I have arranged to do the same.
Quoted 6 lines
I think the logic needs to be (perhaps in Linux's
libxl__default_device_model(gc)only)if (libxl_defbool_val(b_info->device_model_stubdomain) LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL; else LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
Yes, done.
Quoted 4 lines
tools/libxl/libxl_internal.h _hidden libxl__json_object *libxl__json_parse(libxl__gc *gc_opt, const char *s); · line 1561
Quoted 2 lines
tools/libxl/libxl_internal.h +2
-0+/* Return the system-wide default device model: +* qemu-xen for Linux, qemu-xen-traditional for NetBSD. I bet you someone forgets to update this when NetBSD changes ;-)
That remark just needs to go IMO.
So we now have:
[PATCH 1/2] libxl: move check for existence of qemuu device model [PATCH 2/2] libxl: use qemu-xen (upstream QEMU) as device model by default
PATCH v3 1/2 libxl: move check for existence of qemuu device model
In reply to Ian CampbellThe stat in libxl__domain_build_info_setdefault's default device model logic works to fall back to qemu-xen-traditional whenever the executable for qemu-xen is not found.
We are going to use qemu-xen-traditional in more cases, so break this check out into its own if statement.
Also add a pair of braces to make the if() statement symmetrical.
--
New in v3 of series.
--- tools/libxl/libxl_create.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)
tools/libxl/libxl_create.c +8 -5
@@ -105,22 +105,25 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,libxl_defbool_setdefault (&b_info->device_model_stubdomain, false);if (!b_info->device_model_version) { -if (b_info->type ==LIBXL_DOMAIN_TYPE_HVM ) +if (b_info->type ==LIBXL_DOMAIN_TYPE_HVM ) { b_info->device_model_version =LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL ; -else { + }else { + b_info->device_model_version = +LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN ; + } +if (b_info->device_model_version + ==LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN ) {const char *dm;int rc; - b_info->device_model_version = -LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN ; dm =libxl__domain_device_model (gc, b_info); rc =access (dm,X_OK );if (rc <0 ) {/* qemu-xen unavailable, use qemu-xen-traditional */ if (errno ==ENOENT ) {LIBXL__LOG_ERRNO (CTX ,XTL_VERBOSE ,"qemu-xen is unavailable" -", use qemu-xen-traditional instead" ); +", use qemu-xen-traditional instead" ); b_info->device_model_version =LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL ; }else {
Signature · 1 line
1.7.2.5
Re: [PATCH 1/2] libxl: move check for existence of qemuu device model
Quoted 7 lines · Ian Jackson
tools/libxl/libxl_create.c +2
-2+if (b_info->device_model_version + ==LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN ) {const char *dm;int rc; - b_info->device_model_version = -LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN ;
tools/libxl/libxl_create.c int libxl__domain_build_info_setdefault(libxl__gc *gc, · line 128
Quoted 10 lines
tools/libxl/libxl_create.c +1
-1dm =libxl__domain_device_model (gc, b_info); rc =access (dm,X_OK );if (rc <0 ) {/* qemu-xen unavailable, use qemu-xen-traditional */ if (errno ==ENOENT ) {LIBXL__LOG_ERRNO (CTX ,XTL_VERBOSE ,"qemu-xen is unavailable" -", use qemu-xen-traditional instead" ); +", use qemu-xen-traditional instead" ); b_info->device_model_version =LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL ;
After the following change (in 2/2) won't this stat potentially be checking for the qemu-xen-trad binaries, which makes the error message somewhat confusing and also makes the fallback unhelpful.
On a related note we could do with stating the device model even in the case where the user has specified device_model_version explicitly, to give better error reporting in that case too.
Ian.
Re: [PATCH 1/2] libxl: move check for existence of qemuu device model
Ian Campbell writes ("Re: [Xen-devel] [PATCH 1/2] libxl: move check for existence of qemuu device model"):
Quoted 5 lines · Ian Jackson
Quoted 4 lines
tools/libxl/libxl_create.c +2
-0+if (b_info->device_model_version + ==LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN ) {const char *dm;int rc;
...
Quoted 3 lines
Quoted 3 lines
rc = access(dm, X_OK); if (rc < 0) { /* qemu-xen unavailable, use qemu-xen-traditional */
...
Quoted 3 lines
After the following change (in 2/2) won't this stat potentially be checking for the qemu-xen-trad binaries, which makes the error message somewhat confusing and also makes the fallback unhelpful.
No, because the whole thing is in an if which applies only if we're trying to use ..._QEMU_XEN.
Quoted 3 lines
On a related note we could do with stating the device model even in the case where the user has specified
device_model_versionexplicitly, to give better error reporting in that case too.
You mean logging it ?
Ian.
Re: [PATCH 1/2] libxl: move check for existence of qemuu device model
Quoted 10 lines · Ian Jackson
Ian Campbell writes ("Re: [Xen-devel] [PATCH 1/2] libxl: move check for existence of qemuu device model"):
Quoted 5 lines · Ian Jackson
Quoted 4 lines
tools/libxl/libxl_create.c +2
-0+if (b_info->device_model_version + ==LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN ) {const char *dm;int rc;...
Quoted 3 lines
Quoted 3 lines
rc = access(dm, X_OK); if (rc < 0) { /* qemu-xen unavailable, use qemu-xen-traditional */
Quoted 7 lines
...
Quoted 3 lines
After the following change (in 2/2) won't this stat potentially be checking for the qemu-xen-trad binaries, which makes the error message somewhat confusing and also makes the fallback unhelpful.
No, because the whole thing is in an if which applies only if we're trying to use ..._QEMU_XEN.
Oh, right. I combined the tow patches wrongly in my head.
Don't we also want to check for the presence of the trad binary though?
Quoted 5 lines
Quoted 3 lines
On a related note we could do with stating the device model even in the case where the user has specified
device_model_versionexplicitly, to give better error reporting in that case too.You mean logging it ?
Actually I meant "not trying to start the guest regardless and returning success", which AIUI is what happens... Logging would be nice too though.
Quoted 2 lines
Ian.
Re: [PATCH 1/2] libxl: move check for existence of qemuu device model
Ian Campbell writes ("Re: [Xen-devel] [PATCH 1/2] libxl: move check for existence of qemuu device model"):
Quoted 7 lines · Ian Jackson
Quoted 2 lines
No, because the whole thing is in an if which applies only if we're trying to use ..._QEMU_XEN.
Oh, right. I combined the tow patches wrongly in my head.
Don't we also want to check for the presence of the trad binary though?
AIUI the trad binary is always built ? AIUI there is a possibility that the new one isn't ? And that was the rationale for this check ?
CCing Stefano.
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
On a related note we could do with stating the device model even in the case where the user has specified
device_model_versionexplicitly, to give better error reporting in that case too.You mean logging it ?
Actually I meant "not trying to start the guest regardless and returning success", which AIUI is what happens... Logging would be nice too though.
Oh I see. TBH once we start to think about these kinds of installation problems it's difficult to see where we'll stop.
Ian.
Re: [PATCH 1/2] libxl: move check for existence of qemuu device model
Quoted 10 lines · Ian Jackson
Ian Campbell writes ("Re: [Xen-devel] [PATCH 1/2] libxl: move check for existence of qemuu device model"):
Quoted 7 lines · Ian Jackson
Quoted 2 lines
No, because the whole thing is in an if which applies only if we're trying to use ..._QEMU_XEN.
Oh, right. I combined the tow patches wrongly in my head.
Don't we also want to check for the presence of the trad binary though?
AIUI the trad binary is always built ?
By us it is, but e.g. Debian's packaging has been known to omit it, or the user may have overridden the path but made a typo.
Quoted 9 lines
AIUI there is a possibility
that the new one isn't ? And that was the rationale for this check ?CCing Stefano.
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
On a related note we could do with stating the device model even in the case where the user has specified
device_model_versionexplicitly, to give better error reporting in that case too.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
You mean logging it ?
Actually I meant "not trying to start the guest regardless and returning success", which AIUI is what happens... Logging would be nice too though.
Oh I see. TBH once we start to think about these kinds of installation problems it's difficult to see where we'll stop.
This is one which has been tripping people up in practice.
Re: [PATCH 1/2] libxl: move check for existence of qemuu device model
Ian Campbell writes ("Re: [Xen-devel] [PATCH 1/2] libxl: move check for existence of qemuu device model"):
Quoted 5 lines · Ian Jackson
Quoted 2 lines
Oh I see. TBH once we start to think about these kinds of installation problems it's difficult to see where we'll stop.
This is one which has been tripping people up in practice.
OK then.
Should we stat whichever one we intend to use and fall back to the other with a warning, then ?
Ian.
Re: [PATCH 1/2] libxl: move check for existence of qemuu device model
Quoted 5 lines · Ian Jackson
Ian Campbell writes ("Re: [Xen-devel] [PATCH 1/2] libxl: move check for existence of qemuu device model"):
Quoted 4 lines · Ian Jackson
Quoted 2 lines
Oh I see. TBH once we start to think about these kinds of installation problems it's difficult to see where we'll stop.
Quoted 7 lines
Quoted 1 line
This is one which has been tripping people up in practice.
OK then.
Should we stat whichever one we intend to use and fall back to the other with a warning, then ?
Could do that if libxl is the one doing the choosing, I suppose. I'd also be happy with failing explicitly with an appropriate message.
In the case where the user gave an explicit path or version we should obviously use it or fail.
Ian.
Re: [PATCH 1/2] libxl: move check for existence of qemuu device model
Ian Campbell writes ("Re: [Xen-devel] [PATCH 1/2] libxl: move check for existence of qemuu device model"):
Quoted 2 lines
Could do that if libxl is the one doing the choosing, I suppose. I'd also be happy with failing explicitly with an appropriate message.
Right.
Quoted 2 lines
In the case where the user gave an explicit path or version we should obviously use it or fail.
Indeed.
Ian.
Ian Campbell
Acked-byRe: [PATCH 1/2] libxl: move check for existence of qemuu device model
In reply to Ian CampbellQuoted 12 lines · Ian Campbell
Quoted 11 lines · Ian Jackson
Ian Campbell writes ("Re: [Xen-devel] [PATCH 1/2] libxl: move check for existence of qemuu device model"):
Quoted 5 lines · Ian Jackson
Quoted 4 lines
tools/libxl/libxl_create.c +2
-0+if (b_info->device_model_version + ==LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN ) {const char *dm;int rc;...
Quoted 3 lines
Quoted 3 lines
rc = access(dm, X_OK); if (rc < 0) { /* qemu-xen unavailable, use qemu-xen-traditional */...
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
After the following change (in 2/2) won't this stat potentially be checking for the qemu-xen-trad binaries, which makes the error message somewhat confusing and also makes the fallback unhelpful.
No, because the whole thing is in an if which applies only if we're trying to use ..._QEMU_XEN.
Oh, right. I combined the tow patches wrongly in my head.
So I think this patch is good as far as it goes and the rest of this thread is really followup material.
So:
Quoted 22 lines
Don't we also want to check for the presence of the trad binary though?
Quoted 5 lines
Quoted 3 lines
On a related note we could do with stating the device model even in the case where the user has specified
device_model_versionexplicitly, to give better error reporting in that case too.You mean logging it ?
Actually I meant "not trying to start the guest regardless and returning success", which AIUI is what happens... Logging would be nice too though.
Quoted 2 lines
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
PATCH v3 2/2 libxl: use qemu-xen (upstream QEMU) as device model by default
In reply to Ian CampbellFrom: Stefano Stabellini <[email protected]>
--
Changes in v3:
- Fix "use" to "Use" in documentation part
- Do not try to use qemu-xen (upstream) for stubdoms
- Remove a hostage-to-fortune remark in a comment about OS defaults
Changes in v2:
- update the xl man page;
- write a small helper function in libxl_{linux,netbsd}.c to set the default device_model, so that NetBSD can keep using the old version.
--- docs/man/xl.cfg.pod.5 | 12 ++++++------ tools/libxl/libxl_create.c | 10 +++++++--- tools/libxl/libxl_internal.h | 2 ++ tools/libxl/libxl_linux.c | 5 +++++ tools/libxl/libxl_netbsd.c | 5 +++++ 5 files changed, 25 insertions(+), 9 deletions(-)
docs/man/xl.cfg.pod.5 +6 -6
@@ -1176,15 +1176,15 @@ guest. Valid values are: =over 4 -=item B<qemu-xen-traditional> +=item B<qemu-xen> -Use the device-model based upon the historical Xen fork of Qemu. This -device-model is currently the default. +Use the device-model merged into the upstream QEMU project. +This device-model is the default for Linux dom0. -=item B<qemu-xen> +=item B<qemu-xen-traditional> -use the device-model merged into the upstream QEMU project. This -device-model will become the default in a future version of Xen. +Use the device-model based upon the historical Xen fork of Qemu. +This device-model is still the default for NetBSD dom0. =back
tools/libxl/libxl_create.c +7 -3
@@ -105,9 +105,13 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,libxl_defbool_setdefault (&b_info->device_model_stubdomain, false);if (!b_info->device_model_version) { -if (b_info->type ==LIBXL_DOMAIN_TYPE_HVM ) { - b_info->device_model_version = -LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL ; +if (b_info->type ==LIBXL_DOMAIN_TYPE_HVM ) +if (libxl_defbool_val (info->device_model_stubdomain)) { + b_info->device_model_version = +LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL ; + }else { + b_info->device_model_version =libxl__default_device_model (gc); + } }else { b_info->device_model_version =LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN ;
tools/libxl/libxl_internal.h +2 -0
@@ -1561,6 +1561,8 @@ _hidden libxl__json_object *libxl__json_parse(libxl__gc *gc_opt, const char *s);/* Based on /local/domain/$domid/dm-version xenstore key * default is qemu xen traditional */ _hidden int libxl__device_model_version_running(libxl__gc *gc, uint32_t domid); +/* Return the system-wide default device model */ +_hidden libxl_device_model_version libxl__default_device_model(libxl__gc *gc);/* Check how executes hotplug script currently */ int libxl__hotplug_settings (libxl__gc *gc,xs_transaction_t t);
tools/libxl/libxl_linux.c +5 -0
@@ -266,3 +266,8 @@ int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev, out:return rc; } + +libxl_device_model_version libxl__default_device_model (libxl__gc *gc) +{ +return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN ; +}
tools/libxl/libxl_netbsd.c +5 -0
@@ -94,3 +94,8 @@ int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev, out:return rc; } + +libxl_device_model_version libxl__default_device_model (libxl__gc *gc) +{ +return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL ; +}
Signature · 1 line
1.7.2.5
Quoted 11 lines · Ian Jackson
From: Stefano Stabellini <[email protected]>
Signed-off-by Stefano Stabellini <[email protected]>Signed-off-by Ian Jackson <[email protected]>--
Changes in v3:
- Fix "use" to "Use" in documentation part
- Do not try to use qemu-xen (upstream) for stubdoms
- Remove a hostage-to-fortune remark in a comment about OS defaults
Quoted 4 lines
Changes in v2:
- update the xl man page;
- write a small helper function in libxl_{linux,netbsd}.c to set the defaultdevice_model, so that NetBSD can keep using the old version.
it looks OK to me, thanks for picking it up
Quoted 96 lines
docs/man/xl.cfg.pod.5 | 12 ++++++------ tools/libxl/libxl_create.c | 10 +++++++--- tools/libxl/libxl_internal.h | 2 ++ tools/libxl/libxl_linux.c | 5 +++++ tools/libxl/libxl_netbsd.c | 5 +++++ 5 files changed, 25 insertions(+), 9 deletions(-)docs/man/xl.cfg.pod.5 +6
-6@@ -1176,15 +1176,15 @@ guest. Valid values are: =over 4 -=item B<qemu-xen-traditional> +=item B<qemu-xen> -Use the device-model based upon the historical Xen fork of Qemu. This -device-model is currently the default. +Use the device-model merged into the upstream QEMU project. +This device-model is the default for Linux dom0. -=item B<qemu-xen> +=item B<qemu-xen-traditional> -use the device-model merged into the upstream QEMU project. This -device-model will become the default in a future version of Xen. +Use the device-model based upon the historical Xen fork of Qemu. +This device-model is still the default for NetBSD dom0. =backtools/libxl/libxl_create.c +7
-3@@ -105,9 +105,13 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,libxl_defbool_setdefault (&b_info->device_model_stubdomain, false);if (!b_info->device_model_version) { -if (b_info->type ==LIBXL_DOMAIN_TYPE_HVM ) { - b_info->device_model_version = -LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL ; +if (b_info->type ==LIBXL_DOMAIN_TYPE_HVM ) +if (libxl_defbool_val (info->device_model_stubdomain)) { + b_info->device_model_version = +LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL ; + }else { + b_info->device_model_version =libxl__default_device_model (gc); + } }else { b_info->device_model_version =LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN ;tools/libxl/libxl_internal.h +2
-0@@ -1561,6 +1561,8 @@ _hidden libxl__json_object *libxl__json_parse(libxl__gc *gc_opt, const char *s);/* Based on /local/domain/$domid/dm-version xenstore key * default is qemu xen traditional */ _hidden int libxl__device_model_version_running(libxl__gc *gc, uint32_t domid); +/* Return the system-wide default device model */ +_hidden libxl_device_model_version libxl__default_device_model(libxl__gc *gc);/* Check how executes hotplug script currently */ int libxl__hotplug_settings (libxl__gc *gc,xs_transaction_t t);tools/libxl/libxl_linux.c +5
-0@@ -266,3 +266,8 @@ int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev, out:return rc; } + +libxl_device_model_version libxl__default_device_model (libxl__gc *gc) +{ +return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN ; +}tools/libxl/libxl_netbsd.c +5
-0@@ -94,3 +94,8 @@ int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev, out:return rc; } + +libxl_device_model_version libxl__default_device_model (libxl__gc *gc) +{ +return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL ; +}Signature · 1 line
1.7.2.5
Ian Campbell
Acked-byQuoted 12 lines · Stefano Stabellini
Quoted 11 lines · Ian Jackson
From: Stefano Stabellini <[email protected]>
Signed-off-by Stefano Stabellini <[email protected]>Signed-off-by Ian Jackson <[email protected]>--
Changes in v3:
- Fix "use" to "Use" in documentation part
- Do not try to use qemu-xen (upstream) for stubdoms
- Remove a hostage-to-fortune remark in a comment about OS defaults
Quoted 6 lines
Quoted 4 lines
Changes in v2:
- update the xl man page;
- write a small helper function in libxl_{linux,netbsd}.c to set the defaultdevice_model, so that NetBSD can keep using the old version.it looks OK to me, thanks for picking it up
Ian Campbell writes ("Re: [Xen-devel] [PATCH 2/2] libxl: use qemu-xen (upstream QEMU) as device model by default"):
Quoted 4 lines · Stefano Stabellini
Quoted 1 line
it looks OK to me, thanks for picking it up
Acked-by Ian Campbell <[email protected]>
Thanks, pushed both to staging.
Ian.