[libvirt] [PATCH] Make virDomainObjParseNode() static
by Hu Tao
Make virDomainObjParseNode() static since it is called only
in one file.
---
src/conf/domain_conf.c | 38 ++++++++++++++++++++------------------
src/conf/domain_conf.h | 3 ---
2 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 16e1291..c637300 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6081,24 +6081,10 @@ cleanup:
}
-virDomainObjPtr virDomainObjParseFile(virCapsPtr caps,
- const char *filename)
-{
- xmlDocPtr xml;
- virDomainObjPtr obj = NULL;
-
- if ((xml = virXMLParseFile(filename))) {
- obj = virDomainObjParseNode(caps, xml, xmlDocGetRootElement(xml));
- xmlFreeDoc(xml);
- }
-
- return obj;
-}
-
-
-virDomainObjPtr virDomainObjParseNode(virCapsPtr caps,
- xmlDocPtr xml,
- xmlNodePtr root)
+static virDomainObjPtr
+virDomainObjParseNode(virCapsPtr caps,
+ xmlDocPtr xml,
+ xmlNodePtr root)
{
xmlXPathContextPtr ctxt = NULL;
virDomainObjPtr obj = NULL;
@@ -6123,6 +6109,22 @@ cleanup:
return obj;
}
+
+virDomainObjPtr virDomainObjParseFile(virCapsPtr caps,
+ const char *filename)
+{
+ xmlDocPtr xml;
+ virDomainObjPtr obj = NULL;
+
+ if ((xml = virXMLParseFile(filename))) {
+ obj = virDomainObjParseNode(caps, xml, xmlDocGetRootElement(xml));
+ xmlFreeDoc(xml);
+ }
+
+ return obj;
+}
+
+
static int virDomainDefMaybeAddController(virDomainDefPtr def,
int type,
int idx)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 30aeccc..cbd0f98 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1246,9 +1246,6 @@ virDomainDefPtr virDomainDefParseNode(virCapsPtr caps,
virDomainObjPtr virDomainObjParseFile(virCapsPtr caps,
const char *filename);
-virDomainObjPtr virDomainObjParseNode(virCapsPtr caps,
- xmlDocPtr xml,
- xmlNodePtr root);
int virDomainDefAddImplicitControllers(virDomainDefPtr def);
--
1.7.3.1
13 years, 8 months
Re: [libvirt] [PATCH] device-assignment: Reset device on system reset
by Chris Wright
* Alex Williamson (alex.williamson(a)redhat.com) wrote:
> static void reset_assigned_device(DeviceState *dev)
> {
> - PCIDevice *d = DO_UPCAST(PCIDevice, qdev, dev);
> + PCIDevice *pci_dev = DO_UPCAST(PCIDevice, qdev, dev);
> + AssignedDevice *adev = DO_UPCAST(AssignedDevice, dev, pci_dev);
> + char reset_file[64];
> + const char reset[] = "1";
> + int fd, ret;
> +
> + snprintf(reset_file, sizeof(reset_file),
> + "/sys/bus/pci/devices/0000:%02x:%02x.%01x/reset",
> + adev->host.bus, adev->host.dev, adev->host.func);
need to consider segment: %04x:..., adev->host.seg, ...
> + /*
> + * Issue a device reset via pci-sysfs. Note that we use write(2) here
> + * and ignore the return value because some kernels have a bug that
> + * returns 0 rather than bytes written on success, sending us into an
> + * infinite retry loop using other write mechanisms.
> + */
> + fd = open(reset_file, O_WRONLY);
> + if (fd != -1) {
> + ret = write(fd, reset, strlen(reset));
> + close(fd);
> + }
This will probably fail when it's managed by libvirt. I expect it
will need some file ownership and security label mgmt added to device
assignement path I expect.
13 years, 8 months
[libvirt] [PATCH] Support Xen sysctl v8, domctl v7
by Jim Fehlig
xen-unstable c/s 21118:28e5409e3fb3 bumped sysctl version to 8.
xen-unstable c/s 21212:de94884a669c introduced CPU pools feature,
adding another member to xen_domctl_getdomaininfo struct. Add a
corresponding domctl v7 struct in xen hypervisor sub-driver and
detect sysctl v8 during initialization.
---
src/xen/xen_hypervisor.c | 125 ++++++++++++++++++++++++++++++++++------------
1 files changed, 93 insertions(+), 32 deletions(-)
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index 9cb8e8c..47355ce 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -223,11 +223,28 @@ struct xen_v2d6_getdomaininfo {
};
typedef struct xen_v2d6_getdomaininfo xen_v2d6_getdomaininfo;
+struct xen_v2d7_getdomaininfo {
+ domid_t domain; /* the domain number */
+ uint32_t flags; /* flags, see before */
+ uint64_t tot_pages ALIGN_64; /* total number of pages used */
+ uint64_t max_pages ALIGN_64; /* maximum number of pages allowed */
+ uint64_t shr_pages ALIGN_64; /* number of shared pages */
+ uint64_t shared_info_frame ALIGN_64; /* MFN of shared_info struct */
+ uint64_t cpu_time ALIGN_64; /* CPU time used */
+ uint32_t nr_online_vcpus; /* Number of VCPUs currently online. */
+ uint32_t max_vcpu_id; /* Maximum VCPUID in use by this domain. */
+ uint32_t ssidref;
+ xen_domain_handle_t handle;
+ uint32_t cpupool;
+};
+typedef struct xen_v2d7_getdomaininfo xen_v2d7_getdomaininfo;
+
union xen_getdomaininfo {
struct xen_v0_getdomaininfo v0;
struct xen_v2_getdomaininfo v2;
struct xen_v2d5_getdomaininfo v2d5;
struct xen_v2d6_getdomaininfo v2d6;
+ struct xen_v2d7_getdomaininfo v2d7;
};
typedef union xen_getdomaininfo xen_getdomaininfo;
@@ -236,6 +253,7 @@ union xen_getdomaininfolist {
struct xen_v2_getdomaininfo *v2;
struct xen_v2d5_getdomaininfo *v2d5;
struct xen_v2d6_getdomaininfo *v2d6;
+ struct xen_v2d7_getdomaininfo *v2d7;
};
typedef union xen_getdomaininfolist xen_getdomaininfolist;
@@ -273,147 +291,179 @@ typedef struct xen_v2s5_availheap xen_v2s5_availheap;
#define XEN_GETDOMAININFOLIST_ALLOC(domlist, size) \
(hypervisor_version < 2 ? \
(VIR_ALLOC_N(domlist.v0, (size)) == 0) : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ (VIR_ALLOC_N(domlist.v2d7, (size)) == 0) : \
+ (dom_interface_version == 6 ? \
(VIR_ALLOC_N(domlist.v2d6, (size)) == 0) : \
(dom_interface_version == 5 ? \
(VIR_ALLOC_N(domlist.v2d5, (size)) == 0) : \
- (VIR_ALLOC_N(domlist.v2, (size)) == 0))))
+ (VIR_ALLOC_N(domlist.v2, (size)) == 0)))))
#define XEN_GETDOMAININFOLIST_FREE(domlist) \
(hypervisor_version < 2 ? \
VIR_FREE(domlist.v0) : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ VIR_FREE(domlist.v2d7) : \
+ (dom_interface_version == 6 ? \
VIR_FREE(domlist.v2d6) : \
(dom_interface_version == 5 ? \
VIR_FREE(domlist.v2d5) : \
- VIR_FREE(domlist.v2))))
+ VIR_FREE(domlist.v2)))))
#define XEN_GETDOMAININFOLIST_CLEAR(domlist, size) \
(hypervisor_version < 2 ? \
memset(domlist.v0, 0, sizeof(*domlist.v0) * size) : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ memset(domlist.v2d7, 0, sizeof(*domlist.v2d7) * size) : \
+ (dom_interface_version == 6 ? \
memset(domlist.v2d6, 0, sizeof(*domlist.v2d6) * size) : \
(dom_interface_version == 5 ? \
memset(domlist.v2d5, 0, sizeof(*domlist.v2d5) * size) : \
- memset(domlist.v2, 0, sizeof(*domlist.v2) * size))))
+ memset(domlist.v2, 0, sizeof(*domlist.v2) * size)))))
#define XEN_GETDOMAININFOLIST_DOMAIN(domlist, n) \
(hypervisor_version < 2 ? \
domlist.v0[n].domain : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ domlist.v2d7[n].domain : \
+ (dom_interface_version == 6 ? \
domlist.v2d6[n].domain : \
(dom_interface_version == 5 ? \
domlist.v2d5[n].domain : \
- domlist.v2[n].domain)))
+ domlist.v2[n].domain))))
#define XEN_GETDOMAININFOLIST_UUID(domlist, n) \
(hypervisor_version < 2 ? \
domlist.v0[n].handle : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ domlist.v2d7[n].handle : \
+ (dom_interface_version == 6 ? \
domlist.v2d6[n].handle : \
(dom_interface_version == 5 ? \
domlist.v2d5[n].handle : \
- domlist.v2[n].handle)))
+ domlist.v2[n].handle))))
#define XEN_GETDOMAININFOLIST_DATA(domlist) \
(hypervisor_version < 2 ? \
(void*)(domlist->v0) : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ (void*)(domlist->v2d7) : \
+ (dom_interface_version == 6 ? \
(void*)(domlist->v2d6) : \
(dom_interface_version == 5 ? \
(void*)(domlist->v2d5) : \
- (void*)(domlist->v2))))
+ (void*)(domlist->v2)))))
#define XEN_GETDOMAININFO_SIZE \
(hypervisor_version < 2 ? \
sizeof(xen_v0_getdomaininfo) : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ sizeof(xen_v2d7_getdomaininfo) : \
+ (dom_interface_version == 6 ? \
sizeof(xen_v2d6_getdomaininfo) : \
(dom_interface_version == 5 ? \
sizeof(xen_v2d5_getdomaininfo) : \
- sizeof(xen_v2_getdomaininfo))))
+ sizeof(xen_v2_getdomaininfo)))))
#define XEN_GETDOMAININFO_CLEAR(dominfo) \
(hypervisor_version < 2 ? \
memset(&(dominfo.v0), 0, sizeof(xen_v0_getdomaininfo)) : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ memset(&(dominfo.v2d7), 0, sizeof(xen_v2d7_getdomaininfo)) : \
+ (dom_interface_version == 6 ? \
memset(&(dominfo.v2d6), 0, sizeof(xen_v2d6_getdomaininfo)) : \
(dom_interface_version == 5 ? \
memset(&(dominfo.v2d5), 0, sizeof(xen_v2d5_getdomaininfo)) : \
- memset(&(dominfo.v2), 0, sizeof(xen_v2_getdomaininfo)))))
+ memset(&(dominfo.v2), 0, sizeof(xen_v2_getdomaininfo))))))
#define XEN_GETDOMAININFO_DOMAIN(dominfo) \
(hypervisor_version < 2 ? \
dominfo.v0.domain : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ dominfo.v2d7.domain : \
+ (dom_interface_version == 6 ? \
dominfo.v2d6.domain : \
(dom_interface_version == 5 ? \
dominfo.v2d5.domain : \
- dominfo.v2.domain)))
+ dominfo.v2.domain))))
#define XEN_GETDOMAININFO_CPUTIME(dominfo) \
(hypervisor_version < 2 ? \
dominfo.v0.cpu_time : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ dominfo.v2d7.cpu_time : \
+ (dom_interface_version == 6 ? \
dominfo.v2d6.cpu_time : \
(dom_interface_version == 5 ? \
dominfo.v2d5.cpu_time : \
- dominfo.v2.cpu_time)))
+ dominfo.v2.cpu_time))))
#define XEN_GETDOMAININFO_CPUCOUNT(dominfo) \
(hypervisor_version < 2 ? \
dominfo.v0.nr_online_vcpus : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ dominfo.v2d7.nr_online_vcpus : \
+ (dom_interface_version == 6 ? \
dominfo.v2d6.nr_online_vcpus : \
(dom_interface_version == 5 ? \
dominfo.v2d5.nr_online_vcpus : \
- dominfo.v2.nr_online_vcpus)))
+ dominfo.v2.nr_online_vcpus))))
#define XEN_GETDOMAININFO_MAXCPUID(dominfo) \
(hypervisor_version < 2 ? \
dominfo.v0.max_vcpu_id : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ dominfo.v2d7.max_vcpu_id : \
+ (dom_interface_version == 6 ? \
dominfo.v2d6.max_vcpu_id : \
(dom_interface_version == 5 ? \
dominfo.v2d5.max_vcpu_id : \
- dominfo.v2.max_vcpu_id)))
+ dominfo.v2.max_vcpu_id))))
#define XEN_GETDOMAININFO_FLAGS(dominfo) \
(hypervisor_version < 2 ? \
dominfo.v0.flags : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ dominfo.v2d7.flags : \
+ (dom_interface_version == 6 ? \
dominfo.v2d6.flags : \
(dom_interface_version == 5 ? \
dominfo.v2d5.flags : \
- dominfo.v2.flags)))
+ dominfo.v2.flags))))
#define XEN_GETDOMAININFO_TOT_PAGES(dominfo) \
(hypervisor_version < 2 ? \
dominfo.v0.tot_pages : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ dominfo.v2d7.tot_pages : \
+ (dom_interface_version == 6 ? \
dominfo.v2d6.tot_pages : \
(dom_interface_version == 5 ? \
dominfo.v2d5.tot_pages : \
- dominfo.v2.tot_pages)))
+ dominfo.v2.tot_pages))))
#define XEN_GETDOMAININFO_MAX_PAGES(dominfo) \
(hypervisor_version < 2 ? \
dominfo.v0.max_pages : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ dominfo.v2d7.max_pages : \
+ (dom_interface_version == 6 ? \
dominfo.v2d6.max_pages : \
(dom_interface_version == 5 ? \
dominfo.v2d5.max_pages : \
- dominfo.v2.max_pages)))
+ dominfo.v2.max_pages))))
#define XEN_GETDOMAININFO_UUID(dominfo) \
(hypervisor_version < 2 ? \
dominfo.v0.handle : \
- (dom_interface_version >= 6 ? \
+ (dom_interface_version >= 7 ? \
+ dominfo.v2d7.handle : \
+ (dom_interface_version == 6 ? \
dominfo.v2d6.handle : \
(dom_interface_version == 5 ? \
dominfo.v2d5.handle : \
- dominfo.v2.handle)))
+ dominfo.v2.handle))))
static int
@@ -2091,6 +2141,17 @@ xenHypervisorInit(void)
goto done;
}
+ /* Xen 4.1
+ * sysctl version 8 -> xen-unstable c/s 21118:28e5409e3fb3
+ * domctl version 7 -> xen-unstable c/s 21212:de94884a669c
+ */
+ sys_interface_version = 8; /* XEN_SYSCTL_INTERFACE_VERSION */
+ if (virXen_getdomaininfo(fd, 0, &info) == 1) {
+ dom_interface_version = 7; /* XEN_DOMCTL_INTERFACE_VERSION */
+ VIR_DEBUG0("Using hypervisor call v2, sys ver8 dom ver7\n");
+ goto done;
+ }
+
hypervisor_version = 1;
sys_interface_version = -1;
if (virXen_getdomaininfo(fd, 0, &info) == 1) {
--
1.7.3.1
13 years, 8 months
[libvirt] [PATCH] Fix delayed event delivery when SASL is active
by Daniel P. Berrange
When SASL is active, it was possible that we read and decoded
more data off the wire than we initially wanted. The loop
processing this data terminated after only one message to
avoid delaying the calling thread, but this could delay
event delivery. As long as there is decoded SASL data in
memory, we must process it, before returning to the poll()
event loop.
This is a counterpart to the same kind of issue solved in
commit 68d2c3482fa16801f8e6ca5c42698319bb87f385
in a different area of the code
* src/remote/remote_driver.c: Process all pending SASL data
---
src/remote/remote_driver.c | 25 ++++++++++++++++++++-----
1 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 064fc8b..4245fee 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -10426,12 +10426,27 @@ remoteIOHandleInput(virConnectPtr conn, struct private_data *priv,
ret = processCallDispatch(conn, priv, flags);
priv->bufferOffset = priv->bufferLength = 0;
/*
- * We've completed one call, so return even
- * though there might still be more data on
- * the wire. We need to actually let the caller
- * deal with this arrived message to keep good
- * response, and also to correctly handle EOF.
+ * We've completed one call, but we don't want to
+ * spin around the loop forever if there are many
+ * incoming async events, or replies for other
+ * thread's RPC calls. We want to get out & let
+ * any other thread take over as soon as we've
+ * got our reply. When SASL is active though, we
+ * may have read more data off the wire than we
+ * initially wanted & cached it in memory. In this
+ * case, poll() would not detect that there is more
+ * ready todo.
+ *
+ * So if SASL is active *and* some SASL data is
+ * already cached, then we'll process that now,
+ * before returning.
*/
+#if HAVE_SASL
+ if (ret == 0 &&
+ priv->saslconn &&
+ priv->saslDecoded)
+ continue;
+#endif
return ret;
}
}
--
1.7.4
13 years, 8 months
[libvirt] [PATCH] remote: Add missing virCondDestroy calls
by Matthias Bolte
The virCond of the remote_thread_call struct was leaked in some
places. This results in leaking the underlying mutex. Which in turn
leaks a handle on Windows.
Reported by Aliaksandr Chabatar and Ihar Smertsin.
---
See https://www.redhat.com/archives/libvir-list/2011-March/msg00789.html
for the report.
src/remote/remote_driver.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 82e094b..8aa8801 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -8609,6 +8609,7 @@ remoteStreamPacket(virStreamPtr st,
xdr_destroy (&xdr);
ret = remoteIO(st->conn, priv, 0, thiscall);
+ ignore_value(virCondDestroy(&thiscall->cond));
VIR_FREE(thiscall);
if (ret < 0)
return -1;
@@ -8617,6 +8618,7 @@ remoteStreamPacket(virStreamPtr st,
error:
xdr_destroy (&xdr);
+ ignore_value(virCondDestroy(&thiscall->cond));
VIR_FREE(thiscall);
return -1;
}
@@ -8746,6 +8748,7 @@ remoteStreamRecv(virStreamPtr st,
}
ret = remoteIO(st->conn, priv, 0, thiscall);
+ ignore_value(virCondDestroy(&thiscall->cond));
VIR_FREE(thiscall);
if (ret < 0)
goto cleanup;
@@ -9719,6 +9722,7 @@ prepareCall(struct private_data *priv,
error:
xdr_destroy (&xdr);
+ ignore_value(virCondDestroy(&rv->cond));
VIR_FREE(rv);
return NULL;
}
@@ -10818,6 +10822,7 @@ call (virConnectPtr conn, struct private_data *priv,
}
rv = remoteIO(conn, priv, flags, thiscall);
+ ignore_value(virCondDestroy(&thiscall->cond));
VIR_FREE(thiscall);
return rv;
}
--
1.7.0.4
13 years, 8 months
[libvirt] FW: Using dlls for Windows provided in http://libvirt.org/sources/win32_experimental/Libvirt-0.8.7-2.exe
by Aliaksandr Chabatar
Hello libvirt-list,
We have a problem. It concerns CPU usage of libvirt library in Windows. It's not a problem in Linux. See attach.
At the moment we have a workaround for item 1 - we just calculate the number of handles which are leaked and restart our service if the number exceeds 10.000
As for item 2 - we have no real workaround. In 99.99% it should not happen, but there is still 0.01%
In libvirt.log you can find more info as suggested by Daniel.
================================================================
In the attached file, you will find detailed information regarding the case 100 percent CPU usage.
Our test was performed on the following system:
Windows XP SP3;
Libvirt-0.8.8;
Run the following command: virsh -c qemu+tcp: / /172.17.46.88:135/system
Port 135 was one of the ports on which our service is trying to connect.
================================================================
Could you help us here?
Thanks
Alexander
-----Original Message-----
From: Aliaksandr Chabatar
Sent: Tuesday, March 15, 2011 3:52 PM
To: Ihar Smertsin
Subject: FW: [libvirt] Using dlls for Windows provided in http://libvirt.org/sources/win32_experimental/Libvirt-0.8.7-2.exe
Hi Ihar,
Could you provide more information (log files, see below) so we could address this issue to libvir-list(a)redhat.com ?
Mfg
Alexander
-----Original Message-----
From: Daniel P. Berrange [mailto:berrange@redhat.com]
Sent: Tuesday, March 15, 2011 3:08 PM
To: Aliaksandr Chabatar
Cc: Hempfer, Siegfried; Boehme, Alfred; Schnizer, Monika
Subject: Re: [libvirt] Using dlls for Windows provided in http://libvirt.org/sources/win32_experimental/Libvirt-0.8.7-2.exe
On Tue, Mar 15, 2011 at 04:01:31PM +0200, Aliaksandr Chabatar wrote:
> Dear Daniel,
>
> I have another question. It concerns CPU usage of libvirt library
> in Windows. It's not a problem in Linux. See attach.
>
> At the moment we have a workaround for item 1 - we just calculate
> the number of handles which are leaked and restart our service if
> the number exceeds 10.000
It sounds like we have some crazy resource leak in a piece of
code. I'm not too familiar with Windows, but if you re-send
this mail of yours to libvir-list(a)redhat.com, I expect one of
the community members who knows Windows will be able to advise.
> As for item 2 - we have no real workaround. In 99.99% it should
> not happen, but there is still 0.01%
Yeah, that sounds like some piece of code is missing correct
error checking. It would be useful to try and obtain a couple
of stack traces when it is showing 100% cpu usage. Or capture
a libvirt debug log, eg by setting an environment variable
in your client application
LIBVIRT_LOG_FILTERS="1:libvirt 1:util 1:remote"
LIBVIRT_LOG_OUTPUTS="1:file:libvirt.log"
Again, sending this log + the info from your mail to the libvir-list
would be best.
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
13 years, 8 months
[libvirt] [PATCH] docs: Document first release with spice and qxl
by Cole Robinson
---
docs/formatdomain.html.in | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 0c7c965..0835472 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1566,6 +1566,7 @@ qemu-kvm -net nic,model=? /dev/null
to use. It is possible to set a limit on the validity of the password
be giving an timestamp <code>passwdValidTo='2010-04-09T15:51:00'</code>
assumed to be in UTC. NB, this may not be supported by all hypervisors.
+ <span class="since">"spice" since 0.8.6</span>.
</p>
<p>
When SPICE has both a normal and TLS secured TCP port configured, it
@@ -1632,8 +1633,9 @@ qemu-kvm -net nic,model=? /dev/null
<dt><code>model</code></dt>
<dd>
The <code>model</code> element has a mandatory <code>type</code>
- attribute which takes the value "vga", "cirrus", "vmvga", "qxl",
- "xen" or "vbox", depending on the hypervisor features available.
+ attribute which takes the value "vga", "cirrus", "vmvga", "xen",
+ "vbox", or "qxl" (<span class="since">since 0.8.6</span>)
+ depending on the hypervisor features available.
You can also provide the amount of video memory in kilobytes using
<code>vram</code> and the number of screen with <code>heads</code>.
</dd>
--
1.7.4
13 years, 8 months
[libvirt] [PATCH] qemu: Fix copy&paste error messages in text monitor
by Jiri Denemark
---
src/qemu/qemu_monitor_text.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 5df7933..91ecc8b 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -2055,7 +2055,7 @@ try_command:
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
- _("failed to close fd in qemu with '%s'"), cmd);
+ _("failed to attach drive '%s'"), drivestr);
goto cleanup;
}
@@ -2324,7 +2324,7 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon,
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
- _("failed to close fd in qemu with '%s'"), cmd);
+ _("failed to add drive '%s'"), drivestr);
goto cleanup;
}
@@ -2425,8 +2425,8 @@ int qemuMonitorTextSetDrivePassphrase(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
- qemuReportError(VIR_ERR_OPERATION_FAILED,
- _("failed to close fd in qemu with '%s'"), cmd);
+ qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("failed to set disk password"));
goto cleanup;
}
--
1.7.4.1
13 years, 8 months
[libvirt] [PATCH] do not return -1 when human-monitor-command is not supported
by Wen Congyang
It is not a fatal error if some monitor command is not supported.
So we should not return -1 when human-monitor-command is not supported.
Set reply_str to "unknown command: 'human-monitor-command'", and the caller
can deal this error the same as the command that we want to run by
human-monitor-command.
Signed-off-by: Wen Congyang <wency(a)cn.fujitsu.com>
---
src/qemu/qemu_monitor_json.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 13d12c8..7ec4ce7 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -694,6 +694,16 @@ qemuMonitorJSONHumanCommandWithFd(qemuMonitorPtr mon,
if (!cmd || qemuMonitorJSONCommandWithFd(mon, cmd, scm_fd, &reply) < 0)
goto cleanup;
+ if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
+ *reply_str = strdup("unknown command: 'human-monitor-command'");
+ if (!*reply_str) {
+ virReportOOMError();
+ goto cleanup;
+ }
+ ret = 0;
+ goto cleanup;
+ }
+
if (qemuMonitorJSONCheckError(cmd, reply))
goto cleanup;
--
1.7.1
13 years, 8 months
[libvirt] [PATCH] spec: Guess rhel/fedora macros from dist
by Jiri Denemark
---
If anyone knows how to make rpm to evaluate %(...) immediately and not
at every appearance of rhel/fedora, that would be really cool.
libvirt.spec.in | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 02be928..bfc9206 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1,5 +1,11 @@
# -*- rpm-spec -*-
+# if neither fedora nor rhel was defined, try to guess them from %{dist}
+%if !0%{?rhel} && !0%{?fedora}
+%define rhel %(echo "%{?dist}" | sed -ne 's/^\\.el\\([0-9]\\+\\).*/\\1/p')
+%define fedora %(echo "%{?dist}" | sed -ne 's/^\\.fc\\?\\([0-9]\\+\\).*/\\1/p')
+%endif
+
# A client only build will create a libvirt.so only containing
# the generic RPC driver, and test driver and no libvirtd
# Default to a full server + client build
--
1.7.4.1
13 years, 8 months