[libvirt] [PATCH] docs: Add doc for video element

For backwards compatability, if no <video> is set but there is a <graphics> tag, then we add a default <video> according to the guest type. Add docs to tell the user about this to not make them confused. Especially if they remove the video (such as via "virsh edit"), it will be surprised for them to see the video element is still in domain XML. --- docs/formatdomain.html.in | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index f8baffd..455f4dd 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1868,7 +1868,12 @@ qemu-kvm -net nic,model=? /dev/null <dt><code>video</code></dt> <dd> The <code>video</code> element is the a container for describing - video devices. + video devices. NB, for backwards compatability, if no <code>video</code> + is set but there is a <code>graphics</code> in domain xml, then libvirt + will add a default <code>video</code> according to the guest type, e.g. + For a guest of type "kvm", the default <code>video</code> for it is: + <code>type</code> with value "cirrus", <code>vram</code> with value "9216", + and <code>heads</code> with value "1". </dd> <dt><code>model</code></dt> -- 1.7.4

* src/libxl/libxl_driver.c * src/qemu/qemu_process.c --- src/libxl/libxl_driver.c | 7 ++----- src/qemu/qemu_process.c | 13 ++----------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 3491f40..aaab044 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -450,7 +450,6 @@ libxlDomainSetVcpuAffinites(libxlDriverPrivatePtr driver, virDomainObjPtr vm) uint8_t *cpumap = NULL; virNodeInfo nodeinfo; size_t cpumaplen; - unsigned int pos; int vcpu, i; int ret = -1; @@ -471,10 +470,8 @@ libxlDomainSetVcpuAffinites(libxlDriverPrivatePtr driver, virDomainObjPtr vm) cpumask = (uint8_t*) def->cputune.vcpupin[vcpu]->cpumask; for (i = 0; i < VIR_DOMAIN_CPUMASK_LEN; ++i) { - if (cpumask[i]) { - pos = i / 8; - cpumap[pos] |= 1 << (i % 8); - } + if (cpumask[i]) + VIR_USE_CPU(cpumap, i); } map.size = cpumaplen; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 811fa28..fb18fc8 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1212,18 +1212,9 @@ qemuProcessSetVcpuAffinites(virConnectPtr conn, cpumask = (unsigned char *)def->cputune.vcpupin[vcpu]->cpumask; vcpupid = priv->vcpupids[vcpu]; - /* Convert cpumask to bitmap here. */ - for (i = 0; i < VIR_DOMAIN_CPUMASK_LEN; i++) { - int cur = 0; - int mod = 0; - - if (i) { - cur = i / 8; - mod = i % 8; - } - + for (i = 0 ; i < VIR_DOMAIN_CPUMASK_LEN ; i++) { if (cpumask[i]) - cpumap[cur] |= 1 << mod; + VIR_USE_CPU(cpumap, i); } if (virProcessInfoSetAffinity(vcpupid, -- 1.7.4

On 06/02/2011 03:45 AM, Osier Yang wrote:
* src/libxl/libxl_driver.c * src/qemu/qemu_process.c --- src/libxl/libxl_driver.c | 7 ++----- src/qemu/qemu_process.c | 13 ++----------- 2 files changed, 4 insertions(+), 16 deletions(-)
ACK. Trivial cleanup, so safe for 0.9.2.
for (i = 0; i < VIR_DOMAIN_CPUMASK_LEN; ++i) { - if (cpumask[i]) { - pos = i / 8; - cpumap[pos] |= 1 << (i % 8); - } + if (cpumask[i]) + VIR_USE_CPU(cpumap, i); }
-- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 06/03/2011 10:47 PM, Eric Blake wrote:
On 06/02/2011 03:45 AM, Osier Yang wrote:
* src/libxl/libxl_driver.c * src/qemu/qemu_process.c --- src/libxl/libxl_driver.c | 7 ++----- src/qemu/qemu_process.c | 13 ++----------- 2 files changed, 4 insertions(+), 16 deletions(-)
ACK. Trivial cleanup, so safe for 0.9.2.
for (i = 0; i< VIR_DOMAIN_CPUMASK_LEN; ++i) { - if (cpumask[i]) { - pos = i / 8; - cpumap[pos] |= 1<< (i % 8); - } + if (cpumask[i]) + VIR_USE_CPU(cpumap, i); }
Thanks, applied Regards Osier

On 06/02/2011 03:45 AM, Osier Yang wrote:
For backwards compatability, if no <video> is set but there is a
s/compatability/compatibility/
<graphics> tag, then we add a default <video> according to the guest type. Add docs to tell the user about this to not make them confused. Especially if they remove the video (such as via "virsh edit"), it will be surprised for them to see the video element is still in domain XML. --- docs/formatdomain.html.in | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index f8baffd..455f4dd 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1868,7 +1868,12 @@ qemu-kvm -net nic,model=? /dev/null <dt><code>video</code></dt> <dd> The <code>video</code> element is the a container for describing - video devices. + video devices. NB, for backwards compatability, if no <code>video</code>
When reading, I generally find that "NB" doesn't add much to the conversation. Also, this has a typo. How about: s/NB, for backwards compatability,/For backwards compatibility,/
+ is set but there is a <code>graphics</code> in domain xml, then libvirt + will add a default <code>video</code> according to the guest type, e.g. + For a guest of type "kvm", the default <code>video</code> for it is:
s/type, e.g. For/type. For/ ACK with those nits fixed, and since it is doc-only, pushing prior to 0.9.2 is desirable. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 06/03/2011 10:44 PM, Eric Blake wrote:
On 06/02/2011 03:45 AM, Osier Yang wrote:
For backwards compatability, if no<video> is set but there is a
s/compatability/compatibility/
<graphics> tag, then we add a default<video> according to the guest type. Add docs to tell the user about this to not make them confused. Especially if they remove the video (such as via "virsh edit"), it will be surprised for them to see the video element is still in domain XML. --- docs/formatdomain.html.in | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index f8baffd..455f4dd 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1868,7 +1868,12 @@ qemu-kvm -net nic,model=? /dev/null <dt><code>video</code></dt> <dd> The<code>video</code> element is the a container for describing - video devices. + video devices. NB, for backwards compatability, if no<code>video</code>
When reading, I generally find that "NB" doesn't add much to the conversation. Also, this has a typo. How about:
s/NB, for backwards compatability,/For backwards compatibility,/
+ is set but there is a<code>graphics</code> in domain xml, then libvirt + will add a default<code>video</code> according to the guest type, e.g. + For a guest of type "kvm", the default<code>video</code> for it is:
s/type, e.g. For/type. For/
ACK with those nits fixed, and since it is doc-only, pushing prior to 0.9.2 is desirable.
Thanks, pushed with the nits fixed, though late for 0.9.2, :-) Regards Osier
participants (2)
-
Eric Blake
-
Osier Yang