[Libvir] Release of libvirt-0.2.3
by Daniel Veillard
Nearly 2 months without a release, it was clearly time, a lot of changes
had accumulated in CVS. Available from
ftp://libvirt.org/libvirt/
* Documentation:
- documentation for upcoming remote access (Richard Jones)
- virConnectNumOfDefinedDomains doc (Jan Michael)
- virsh help messages for dumpxml and net-dumpxml (Chris Wright)
* Bug fixes:
- RelaxNG schemas regexp fix (Robin Green)
- RelaxNG arch bug (Mark McLoughlin)
- large buffers bug fixes (Shigeki Sakamoto)
- error on out of memory condition (Shigeki Sakamoto)
- virshStrdup fix
- non-root driver when using Xen bug (Richard Jones)
- use --strict-order when running dnsmasq (Daniel Berrange)
- virbr0 weirdness on restart (Mark McLoughlin)
- keep connection error messages (Richard Jones)
- increase QEmu read buffer on help (Daniel Berrange)
- rpm dependance on dnsmasq (Daniel Berrange)
- fix XML boot device syntax (Daniel Berrange)
- QEmu memory bug (Daniel Berrange)
- memory leak fix (Masayuki Sunou)
- fix compiler flags (Richard Jones)
- remove type ioemu on recent Xen HVM for paravirt drivers (Saori Fukuta)
- uninitialized string bug (Masayuki Sunou)
- allow init even if the daemon is not running
- XML to config fix (Daniel Berrange)
* Improvements:
- add a special error class for the test module (Richard Jones)
- virConnectGetCapabilities on proxy (Richard Jones)
- allow network driver to decline usage (Richard Jones)
- extend error messages for upcoming remote access (Richard Jones)
- on_reboot support for QEmu (Daniel Berrange)
- save daemon output in a log file (Daniel Berrange)
- xenXMDomainDefineXML can override guest config (Hugh Brock)
- add attach-device and detach-device commands to virsh (Masayuki Sunou and
Mark McLoughlin and Richard Jones)
- make virGetVersion case insensitive and Python bindings (Richard Jones)
- new scheduler API (Atsushi SAKAI)
- localizations updates
- add logging option for virsh (Nobuhiro Itou)
- allow arguments to be passed to bootloader (Hugh Brock)
- increase the test suite (Daniel Berrange and Hugh Brock)
* Cleanups:
- Remove VIR_DRV_OPEN_QUIET (Richard Jones)
- disable xm_internal.c for Xen > 3.0.3 (Daniel Berrange)
- unused fields in _virDomain (Richard Jones)
- export __virGetDomain and __virGetNetwork for libvirtd only (Richard Jones)
- ignore old VNC config for HVM on recent Xen (Daniel Berrange)
- various code cleanups
- -Werror cleanup (Hugh Brock)
thanks to everybody who helped for this release with bug reports or patches !
Daniel
--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
17 years, 5 months
[Libvir] [PATCH] add bootloader_args to libvirt xml to support bootloaders (like pypxeboot for example) that require arguments
by Hugh Brock
This patch extends libvirt's XML to include a paramater Xen already
supports in sexpr, "bootloader_args." The bootloader_args parameter lets
you pass arguments -- "mac=aa:12:34:56:78:90" for example -- to a
bootloader program that xend invokes when it starts a guest. One such
program, pypxeboot, uses the mac= argument to communicate with a dhcp
server and retrieve the pxeboot kernel and initrd for a paravirt guest.
The patch includes new tests for the bootloader_args XML and sexpr,
which pass.
Note that for the head of current libvirt, the virsh tests do not pass
and virsh will not connect to the xen hypervisor. I don't know if this
is my own build environment or some other issue. However the failure is
the same with or without this patch, so I am submitting it anyway.
Please let me know what you think...
--Hugh
--
Red Hat Virtualization Group http://redhat.com/virtualization
Hugh Brock | virt-manager http://virt-manager.org
hbrock(a)redhat.com | virtualization library http://libvirt.org
17 years, 5 months
[Libvir] [PATCH] output virsh log to file
by Nobuhiro Itou
Hi,
I made the patch which output debug messages and error messages
of virsh to the log file.
I think that it is necessary to leave logs to the file for the
investigation at the failure.
Debug messages can take appointed optional information,
and error messages will make it easy to specify a cause.
Moreover, I'm thinking about outputting virterror information
to the virsh log file by the next step.
It is simple specifications as follows.
* Destination -- <USER HOME>/.virsh/virsh.log
* Log size -- 1MB(1024*1024)
* Number of Rotations -- 5
* There is process exclusion.
First, will you take in this patch ?
And, I have a plan to enhance logging functionality.
(for example, libvirt error logging)
Signed-off-by: Nobuhiro Itou <fj0873gn(a)aa.jp.fujitsu.com>
Thanks,
Nobuhiro Itou.
17 years, 5 months
[Libvir] [PATCH] Cut out "type=ioemu" on Xen3.1
by Saori Fukuta
Hi,
The definition of (type ioemu) is *not* required by Xen3.1.
So I cut out it when xendConfigVersion is 4 or later.
Signed-off-by: Saori Fukuta <fukuta.saori(a)jp.fujitsu.com>
Thanks,
Saori Fukuta.
Index: xml.c
===================================================================
RCS file: /data/cvs/libvirt/src/xml.c,v
retrieving revision 1.73
diff -u -p -r1.73 xml.c
--- xml.c 23 Apr 2007 07:41:23 -0000 1.73
+++ xml.c 31 May 2007 07:02:01 -0000
@@ -1047,6 +1047,7 @@ virDomainParseXMLDiskDesc(virConnectPtr
* @conn: pointer to the hypervisor connection
* @node: node containing the interface description
* @buf: a buffer for the result S-Expr
+ * @xendConfigVersion: xend configuration file format
*
* Parse the one interface the XML description and add it to the S-Expr in buf
* This is a temporary interface as the S-Expr interface
@@ -1056,7 +1057,7 @@ virDomainParseXMLDiskDesc(virConnectPtr
* Returns 0 in case of success, -1 in case of error.
*/
static int
-virDomainParseXMLIfDesc(virConnectPtr conn ATTRIBUTE_UNUSED, xmlNodePtr node, virBufferPtr buf, int hvm)
+virDomainParseXMLIfDesc(virConnectPtr conn ATTRIBUTE_UNUSED, xmlNodePtr node, virBufferPtr buf, int hvm, int xendConfigVersion)
{
xmlNodePtr cur;
xmlChar *type = NULL;
@@ -1129,7 +1130,8 @@ virDomainParseXMLIfDesc(virConnectPtr co
virBufferVSprintf(buf, "(script '%s')", script);
if (ip != NULL)
virBufferVSprintf(buf, "(ip '%s')", ip);
- if (hvm)
+ /* HVM type ioemu config for xen < 3.1 */
+ if (hvm && xendConfigVersion < 4)
virBufferAdd(buf, "(type ioemu)", 12);
virBufferAdd(buf, ")", 1);
@@ -1335,7 +1337,7 @@ virDomainParseXMLDesc(virConnectPtr conn
if (nb_nodes > 0) {
for (i = 0; i < nb_nodes; i++) {
virBufferAdd(&buf, "(device ", 8);
- res = virDomainParseXMLIfDesc(conn, nodes[i], &buf, hvm);
+ res = virDomainParseXMLIfDesc(conn, nodes[i], &buf, hvm, xendConfigVersion);
if (res != 0) {
free(nodes);
goto error;
@@ -1494,7 +1496,7 @@ virParseXMLDevice(virConnectPtr conn, ch
goto error;
}
else if (xmlStrEqual(node->name, BAD_CAST "interface")) {
- if (virDomainParseXMLIfDesc(conn, node, &buf, hvm) != 0)
+ if (virDomainParseXMLIfDesc(conn, node, &buf, hvm, xendConfigVersion) != 0)
goto error;
}
cleanup:
17 years, 5 months
Re: [Libvir] [PATCH] add scheduler API(take 3?)
by Richard W.M. Jones
+char *
+virDomainGetSchedulerType(virDomainPtr domain, int *nparams)
+{
+ virConnectPtr conn;
+ char *schedtype;
+
+ if (domain == NULL) {
+ TODO
+ return NULL;
+ }
Is this case an error, or were you thinking of adding more semantics
later on here?
(and the same comment for virDomainGet/SetSchedulerParameters)
+static int
+cmdSchedinfo(vshControl * ctl, vshCmd * cmd)
+{
[...]
+ char *str_weight = strdup("weight");
+ char *str_cap = strdup("cap");
+
+ nparams = malloc(sizeof(int));
+ *nparams = 0;
+
+ if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ return FALSE;
There's still a problem memory leak here.
+ /* Currently supports Xen Credit only */
+ weight = vshCommandOptInt(cmd, "weight", &weightfound);
+ if(weightfound){ inputparam++; }
+
+ cap = vshCommandOptInt(cmd, "cap", &capfound);
+ if(capfound){ inputparam++; }
and can this be made so it isn't Xen-specific?
+ if ((domain == NULL) || (domain->conn == NULL))
+ return -1;
+
+ priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
+ if (priv->handle < 0 || domain->id < 0)
+ return -1;
At the lowest level, these functions should return error messages back
to the upper layers. Otherwise users have nothing to diagnose errors with.
+ /*
+ * Support only dom_interface_version >=5
+ * (Xen3.1.0 or later)
+ */
+ if (dom_interface_version < 5)
+ return -1;
Is this because earlier hypervisors didn't support this, or is it just
not implemented?
Rich.
17 years, 5 months
[Libvir] [PATCH] Fix strange error message in virsh attach-device
by Masayuki Sunou
Hi
Now, virsh attach-device displays the following messages when "device"
attribute of "disk" element is "floppy" in XML.
# virsh attach-device HVM_RH4_file floppy.xml
libvir: Xen Daemon error : POST operation failed: (xend.err 'Invalid Configuration: XendConfig: @\x14\xce not a valid device type')
error: Failed to attach device from floppy.xml
This patch fixes this strange error message displaying "@\x14\xce".
Description of this patch
VirDomainParseXMLDiskDesc() returns 0 without putting data in virBuffer,
when "floppy" is set.
Therefore, virParseXMLDevice() returns no initialized data, and
xenDaemonAttachDevice() passes Xen this data.
Because virDomainParseXMLDesc() works wrong when this patch changes
return value of VirDomainParseXMLDiskDesc(),this patch fixes
virParseXMLDevice() as follows.
- Initialize data
- Return error if data does not change.
As a result, xenDaemonAttachDevice() doesn't pass strange data to Xen,
and Xen doesn't return strange error message.
Signed-off-by: Masayuki Sunou <fj1826dm(a)aa.jp.fujitsu.com>
Thanks,
Masayuki Sunou.
----------------------------------------------------------------------
Index: src/xml.c
===================================================================
RCS file: /data/cvs/libvirt/src/xml.c,v
retrieving revision 1.73
diff -u -p -r1.73 xml.c
--- src/xml.c 23 Apr 2007 07:41:23 -0000 1.73
+++ src/xml.c 25 May 2007 09:46:56 -0000
@@ -1481,6 +1481,7 @@ virParseXMLDevice(virConnectPtr conn, ch
return (NULL);
buf.size = 1000;
buf.use = 0;
+ memset(buf.content, 0, (size_t)buf.size);
xml = xmlReadDoc((const xmlChar *) xmldesc, "domain.xml", NULL,
XML_PARSE_NOENT | XML_PARSE_NONET |
XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
@@ -1492,6 +1493,9 @@ virParseXMLDevice(virConnectPtr conn, ch
if (xmlStrEqual(node->name, BAD_CAST "disk")) {
if (virDomainParseXMLDiskDesc(conn, node, &buf, hvm, xendConfigVersion) != 0)
goto error;
+ /* SXP is not created when device is "floppy". */
+ else if (!strlen(buf.content))
+ goto error;
}
else if (xmlStrEqual(node->name, BAD_CAST "interface")) {
if (virDomainParseXMLIfDesc(conn, node, &buf, hvm) != 0)
----------------------------------------------------------------------
17 years, 5 months