[libvirt] [PATCH] network: match xml warning message
by Eric Blake
I noticed that /var/lib/libvirt/dnsmasq/*.conf used the wrong word;
it was intended to match the wording in src/util/xml.c.
* src/network/bridge_driver.c (networkDnsmasqConfContents): Fix typo.
---
Pushing under the trivial rule.
src/network/bridge_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 3dd98ad..4e1958d 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -669,7 +669,7 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
"##OVERWRITTEN AND LOST. Changes to this "
"configuration should be made using:\n"
"## virsh net-edit %s\n"
- "## of other applications using the libvirt API.\n"
+ "## or other application using the libvirt API.\n"
"##\n## dnsmasq conf file created by libvirt\n"
"strict-order\n"
"domain-needed\n",
--
1.8.0.2
12 years, 1 month
[libvirt] RFC: Death to the BQDL (Big QEMU Driver Lock)
by Daniel P. Berrange
Many years ago when the QEMU driver was first written for libvirt the
daemon was single threaded, so we didn't have to worry about locking
at all. Then we introduced threads and so we had to have locking.
Since then locking has been done at two levels. The big QEMU driver
lock must be acquired first, then the per-VM lock could be acquired.
If no field in the driver struct was used, we could quickly
release the QEMU driver lock and only hold the per-VM lock.
Over time though, our code has got more & more complicated to the
point where we have to hold the big QEMU driver lock in the vast
majority of methods. We mitigate this by releasing the locks when
sleeping on monitor API calls, but this is still a huge bottleneck.
This is particularly apparent when you look at concurrency when
starting/stopping guests.
This scalability limitation is at a point where it is unacceptable
for us to continue as we do today.
Band-aids no longer suffice. To fix this for the long term, we need
to dramatically change the locking approach we use in the QEMU driver.
The only way we can achieve this is by dramatically changing the way
we update/access QEMU driver state.
The core problem is that the qemu driver struct holds a vast array
of (often unrelated) data, with differing access patterns. It is
clear that a single lock is not a suitable level of granularity for
this. Looking at what is in the struct we can classify data into a
number of buckets
1. Read-only data that never changes for lifetime of libvirtd.
eg
- char *configDir
- char *libDir
- bool privileged;
- const char *uri;
- virThreadPoolPtr workerPool
2. Read-only data that never changes for as long as the config
file is not reloaded. (Currently equivalent to previous bucket
since we don't support reloading qemu.conf - we need to support
that in the future)
eg
- uid_t user;
- uid_t group;
- int dynamicOwnership;
- unsigned int vncTLS :1;
- unsigned int vncSASL :1;
- char *vncListen;
3. Read-write data that changes at arbitrary times
eg
- virDomainObjList domains
- size_t nactive
- pciDeviceList *activePciHostdevs;
- usbDeviceList *activeUsbHostdevs;
- virHashTablePtr closeCallbacks;
My proposal for dealing with things is as follows
1. Read-only data that never changes for lifetime of libvirtd.
Turn the current driver mutex into a driver RW-lock. All API
calls will always acquire a read-lock at start, hold it for
the lifetime of their execution and release it at the end.
API calls will never directly acquire write locks.
The QEMU driver startup / shutdown global initializers will
acquire write-locks. This ensures the daemon can't shutdown
while any APIs are being executed.
2. Read-only data that never changes for as long as the config
file is not reloaded.
Move all of this data out into a new virQEMUDriverConfigPtr
struct, which is an instance of virObject. The virQEMUDriverPtr
will hold the primary reference to the config. The contents
of this object struct will be considered immutable once
initialized.
When an API needs to access config file, it will obtain a
reference on the config object. Obtaining the reference
will involve acquiring & releasing the driver lock.
If the QEMU driver needs to reload the config, it will populate
a completely new virQEMUDriverConfigPtr instance, and unref
the existing one.
Thus access to data in virQEMUDriverConfigPtr can be completely
lockless once an instance has been acquired, despite the possiblity
of the config being updated at an arbitrary time.
cf RCU (read-copy-update)
3. Read-write data that changes at arbitrary times.
All data that can be changed must be stored in a dedicated
virObject based instance. Each object must provide its own
internal locking mechanisms targetted to the type of data
being stored.
Some objects may need some re-architecting to allow them to
operate effectively without the protection of the long lived
QEMU driver lock. For example during domain startup, we rely
on the QEMU driver lock to protect against races between the
time we check for an existing VM with (name,uuid), and the
time we actually finish starting the new VM & store it in
the domain list. To deal with this the virDomainObjList
will need to have some concept of a 'reserved name,uuid'
so safety is ensured, despite not holding a lock for the whole
start operation.
So I lied slightly when I said this was the death of the big QEMU
driver lock. The big QEMU driver lock still exists, but API calls
only ever need to have read-locks. Write-locks are only held for
libvirtd startup/shutdown, and for the tiny time window it takes
to grab a reference to a virQEMUDriverConfigPtr.
Access to config params is completely lockless, even allowing for
their live update.
All the remaining exclusive locks will be pushed down into individual
objects which need them, hopefully ensuring high concurrency of
operation.
Implementing this all is a non-trivial job, so I envisage the following
order of attack
1. Create the virQEMUDriverConfigPtr object & move config file
parameters into that.
2. Encapsulte all read-writable state into objects with dedicated
locking
3. Turn QEMU driver mutex into a read-write lock
4. Convert all APIs to only hold read-locks on QEMU driver.
Regards,
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 :|
12 years, 1 month
[libvirt] [PATCH] util: rework error reporting in virGet(User|Group)IDByName
by Peter Krempa
This patch gets rid of the undeterministic error reporting code done on
return values of get(pw|gr)nam_r. With this patch, if the group record
is not returned by the corresponding function this error is not
considered fatal even if errno != 0. The error is logged in such case.
---
src/util/util.c | 50 ++++++++++++++++++--------------------------------
1 file changed, 18 insertions(+), 32 deletions(-)
diff --git a/src/util/util.c b/src/util/util.c
index 3f244f5..27af3c6 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -2530,23 +2530,16 @@ virGetUserIDByName(const char *name, uid_t *uid)
}
}
- if (rc != 0) {
- /* We explicitly test for the known error values returned by
- * getpwnam_r as the manpage says:
- * ERRORS
- * 0 or ENOENT or ESRCH or EBADF or EPERM or ...
- * The given name or uid was not found.
- */
- if ((rc == EINTR) || (rc == EIO) || (rc == EMFILE) ||
- (rc == ENFILE) || (rc == ENOMEM)) {
- virReportSystemError(rc, _("Failed to get user record for name '%s'"),
- name);
- goto cleanup;
- }
- }
-
if (!pw) {
- VIR_DEBUG("User record for user '%s' does not exist", name);
+ if (rc != 0) {
+ char buf[1024];
+ /* log the possible error from getpwnam_r. Unfortunately error
+ * reporting from this function is bad and we can't really
+ * rely on it, so we just report that the user wasn't found */
+ VIR_WARN("User record for user '%s' does was not found: %s",
+ name, virStrerror(rc, buf, sizeof(buf)));
+ }
+
ret = 1;
goto cleanup;
}
@@ -2621,23 +2614,16 @@ virGetGroupIDByName(const char *name, gid_t *gid)
}
}
- if (rc != 0) {
- /* We explicitly test for the known error values returned by
- * getgrnam_r as the manpage says:
- * ERRORS
- * 0 or ENOENT or ESRCH or EBADF or EPERM or ...
- * The given name or gid was not found.
- */
- if ((rc == EINTR) || (rc == EIO) || (rc == EMFILE) ||
- (rc == ENFILE) || (rc == ENOMEM)) {
- virReportSystemError(rc, _("Failed to get group record for name '%s'"),
- name);
- goto cleanup;
- }
- }
-
if (!gr) {
- VIR_DEBUG("Group record for group '%s' does not exist", name);
+ if (rc != 0) {
+ char buf[1024];
+ /* log the possible error from getgrnam_r. Unfortunately error
+ * reporting from this function is bad and we can't really
+ * rely on it, so we just report that the user wasn't found */
+ VIR_WARN("Group record for user '%s' does was not found: %s",
+ name, virStrerror(rc, buf, sizeof(buf)));
+ }
+
ret = 1;
goto cleanup;
}
--
1.8.0
12 years, 1 month
[libvirt] [PATCH] S390: Fix virSysinfoRead memory corruption
by Viktor Mihajlovski
There was a double free issue caused by virSysinfoRead on s390,
as the same manufacturer string instance was assigned to more
than one processor record.
Cleaned up other potential memory issues and restructured the sysinfo
parsing code by moving repeating patterns into a helper function.
BTW: I hit an issue with using strchr(string,variable), as I am
still compiling with gcc 4.4.x, see
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36513
I circumvented this using index(), which is deprecated, but working.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
src/util/sysinfo.c | 160 ++++++++++++++++++++++-----------------------------
1 files changed, 69 insertions(+), 91 deletions(-)
diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
index bac4b23..0be5b75 100644
--- a/src/util/sysinfo.c
+++ b/src/util/sysinfo.c
@@ -240,114 +240,91 @@ no_memory:
#elif defined(__s390__) || defined(__s390x__)
+static char *
+virSysinfoParseDelimited(const char *base, const char *name, char **value,
+ char delim1, char delim2)
+{
+ const char *start;
+ char *end;
+
+ if (delim1 != delim2 &&
+ (start = strstr(base, name)) &&
+ (start = index(start, delim1))) { /* using index as strchr produces compile error on older gcc's - see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36513 */
+ start += 1;
+ end = strchrnul(start, delim2);
+ virSkipSpaces(&start);
+ if (!((*value) = strndup(start, end - start))) {
+ virReportOOMError();
+ goto error;
+ }
+ virTrimSpaces(*value, NULL);
+ return end;
+ }
+
+error:
+ return NULL;
+}
+
+static char *
+virSysinfoParseLine(const char *base, const char *name, char **value)
+{
+ return virSysinfoParseDelimited(base, name, value, ':', '\n');
+}
+
static int
virSysinfoParseSystem(const char *base, virSysinfoDefPtr ret)
{
- char *cur, *eol = NULL;
- const char *property;
-
- /* Return if Manufacturer field is not found */
- if ((cur = strstr(base, "Manufacturer")) == NULL)
+ if (virSysinfoParseLine(base, "Manufacturer",
+ &ret->system_manufacturer) &&
+ virSysinfoParseLine(base, "Type",
+ &ret->system_family) &&
+ virSysinfoParseLine(base, "Sequence Code",
+ &ret->system_serial))
return 0;
-
- base = cur;
- if ((cur = strstr(base, "Manufacturer")) != NULL) {
- cur = strchr(cur, ':') + 1;
- eol = strchr(cur, '\n');
- virSkipSpacesBackwards(cur, &eol);
- if ((eol) && ((property = strndup(cur, eol - cur)) == NULL))
- goto no_memory;
- virSkipSpaces(&property);
- ret->system_manufacturer = (char *) property;
- }
- if ((cur = strstr(base, "Type")) != NULL) {
- cur = strchr(cur, ':') + 1;
- eol = strchr(cur, '\n');
- virSkipSpacesBackwards(cur, &eol);
- if ((eol) && ((property = strndup(cur, eol - cur)) == NULL))
- goto no_memory;
- virSkipSpaces(&property);
- ret->system_family = (char *) property;
- }
- if ((cur = strstr(base, "Sequence Code")) != NULL) {
- cur = strchr(cur, ':') + 1;
- eol = strchr(cur, '\n');
- virSkipSpacesBackwards(cur, &eol);
- if ((eol) && ((property = strndup(cur, eol - cur)) == NULL))
- goto no_memory;
- virSkipSpaces(&property);
- ret->system_serial = (char *) property;
- }
-
- return 0;
-
-no_memory:
- return -1;
+ else
+ return -1;
}
static int
virSysinfoParseProcessor(const char *base, virSysinfoDefPtr ret)
{
- char *cur, *eol, *tmp_base;
- char *manufacturer;
- const char *tmp;
+ char *tmp_base;
+ char *manufacturer = NULL;
+ char *procline = NULL;
+ int result = -1;
virSysinfoProcessorDefPtr processor;
- if ((cur = strstr(base, "vendor_id")) != NULL) {
- cur = strchr(cur, ':') + 1;
- eol = strchr(cur, '\n');
- virSkipSpacesBackwards(cur, &eol);
- if ((eol) && ((tmp = strndup(cur, eol - cur)) == NULL))
- goto no_memory;
- virSkipSpaces(&tmp);
- manufacturer = (char *) tmp;
- }
-
- /* Find processor N: line and gather the processor manufacturer, version,
- * serial number, and family */
- while ((tmp_base = strstr(base, "processor ")) != NULL) {
- base = tmp_base;
- eol = strchr(base, '\n');
- cur = strchr(base, ':') + 1;
+ if (!(tmp_base=virSysinfoParseLine(base, "vendor_id", &manufacturer)))
+ goto cleanup;
+ /* Find processor N: line and gather the processor manufacturer,
+ version, serial number, and family */
+ while ((tmp_base = strstr(tmp_base, "processor "))
+ && (tmp_base = virSysinfoParseLine(tmp_base, "processor ",
+ &procline))) {
if (VIR_EXPAND_N(ret->processor, ret->nprocessor, 1) < 0) {
- goto no_memory;
+ virReportOOMError();
+ goto cleanup;
}
-
processor = &ret->processor[ret->nprocessor - 1];
-
- /* Set the processor manufacturer */
- processor->processor_manufacturer = manufacturer;
-
- if ((cur = strstr(base, "version =")) != NULL) {
- cur += sizeof("version =");
- eol = strchr(cur, ',');
- if ((eol) &&
- ((processor->processor_version = strndup(cur, eol - cur)) == NULL))
- goto no_memory;
- }
- if ((cur = strstr(base, "identification =")) != NULL) {
- cur += sizeof("identification =");
- eol = strchr(cur, ',');
- if ((eol) &&
- ((processor->processor_serial_number = strndup(cur, eol - cur)) == NULL))
- goto no_memory;
- }
- if ((cur = strstr(base, "machine =")) != NULL) {
- cur += sizeof("machine =");
- eol = strchr(cur, '\n');
- if ((eol) &&
- ((processor->processor_family = strndup(cur, eol - cur)) == NULL))
- goto no_memory;
- }
-
- base = cur;
+ processor->processor_manufacturer = strdup(manufacturer);
+ if (!virSysinfoParseDelimited(procline, "version",
+ &processor->processor_version,
+ '=', ',') ||
+ !virSysinfoParseDelimited(procline, "identification",
+ &processor->processor_serial_number,
+ '=', ',') ||
+ !virSysinfoParseDelimited(procline, "machine",
+ &processor->processor_family,
+ '=', '\n'))
+ goto cleanup;
}
+ result = 0;
- return 0;
-
-no_memory:
- return -1;
+cleanup:
+ VIR_FREE(manufacturer);
+ VIR_FREE(procline);
+ return result;
}
/* virSysinfoRead for s390x
@@ -388,6 +365,7 @@ virSysinfoRead(void) {
return ret;
no_memory:
+ virSysinfoDefFree(ret);
VIR_FREE(outbuf);
return NULL;
}
--
1.7.0.4
12 years, 1 month
Re: [libvirt] RFC: Enable Libvirt to handle OVA installation
by Ata Bohra
> > [AB]: Unfortunately I could not find any way to perform this rather than
> > accomodating it inside libvirt. As mentioned more of the issue is: OVA
> > installation is handled by hypervisor in more than one step, they do not
> > expose specific APIs to load compressed disk associated with one VM, please
> > correct me if my understanding is wrong here. It means then this feature
> > could be blessed within libvirt framework at all :(.
> >
> > For educational purpose, I want to ask why is "OVA installtion" is
> > considered so alien. To me it is one of the ways to manage VM distribution
> > in an hypervisor agnostic way.
> >
>
> Point me to an OVA that's available and a way to load it & run it
> without forking money over to VMWare and I'll take a look and provide
> suggestions on how to best implement this for you.
>
> --
> Doug Goldstein
Please find a tiny OVA attached along with this mail, I wanted to share Microcore linux package but as size was 6.7 MB, mail was rejected by libvirt server (Mircrocore linux). ESX hypervisor comes in a free version and also it provides a web tool to access it (vSphere Client again free download), this tool allows to spit out OVA/OVF for installed VMs (installation can be done using free CD installations). OVAs can be generated using API calls as well. Steps using vSphere Client:1. Create a new VM giving path to OVA file.2. Select VM params such as: name, virtual hardware details (memory, CPU, datastore, networking etc.).3. Installation creates VMs, imports vdisks from OVA and gives a functional VM at the end. Steps using vSphere API (libvirt way to do it):1. ParseOVFDescriptor (this involves calling vSphere API with OVF descriptor stored in OVA). 2. InstallvAPP: this is responsible to create domain on the hypervisor and once it is done it returns a lease object (HttpLeaseObject). This object is to be used to upload the compressed virtual disk to the ESX hypervisor. Working with it I did not feel there is a need to get any license or pay VMWare in one way or the other, one can create OVAs easily and export it to different hypervisors as VM distros. Further, marketplace may provide free OVA downloads :-). Thanks!Ata
12 years, 1 month
[libvirt] [PATCH] build: Fix make check with different object directory
by Viktor Mihajlovski
make check fails in check-symsorting if configure is not run in
the source directory. Prefixing symfile names with $(srcdir)
fixes this.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
src/Makefile.am | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 7cb1d4a..8f7890b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -739,7 +739,7 @@ libvirt_driver_la_CFLAGS = $(NUMACTL_CFLAGS) $(GNUTLS_CFLAGS) \
-I$(top_srcdir)/src/conf $(AM_CFLAGS)
libvirt_driver_la_LIBADD = $(NUMACTL_LIBS) $(GNUTLS_LIBS) $(DLOPEN_LIBS)
-USED_SYM_FILES = libvirt_private.syms
+USED_SYM_FILES = $(srcdir)/libvirt_private.syms
if WITH_TEST
noinst_LTLIBRARIES += libvirt_driver_test.la
@@ -1337,43 +1337,43 @@ endif
#
if WITH_DRIVER_MODULES
-USED_SYM_FILES += libvirt_driver_modules.syms
+USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
endif
if WITH_LINUX
-USED_SYM_FILES += libvirt_linux.syms
+USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
endif
if WITH_ESX
-USED_SYM_FILES += libvirt_esx.syms
+USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
endif
if WITH_LIBVIRTD
-USED_SYM_FILES += libvirt_daemon.syms
+USED_SYM_FILES += $(srcdir)/libvirt_daemon.syms
endif
if WITH_OPENVZ
-USED_SYM_FILES += libvirt_openvz.syms
+USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
endif
if WITH_VMX
-USED_SYM_FILES += libvirt_vmx.syms
+USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
endif
if WITH_XENXS
-USED_SYM_FILES += libvirt_xenxs.syms
+USED_SYM_FILES += $(srcdir)/libvirt_xenxs.syms
endif
if HAVE_SASL
-USED_SYM_FILES += libvirt_sasl.syms
+USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
endif
if HAVE_LIBSSH2
-USED_SYM_FILES += libvirt_libssh2.syms
+USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
endif
if WITH_ATOMIC_OPS_PTHREAD
-USED_SYM_FILES += libvirt_atomic.syms
+USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
endif
EXTRA_DIST += \
--
1.7.0.4
12 years, 1 month
[libvirt] [PATCH v2 1/4] qemu: add qemu various VGA devices Caps flag
by Guannan Ren
QEMU_CAPS_DEVICE_QXL -device qxl
QEMU_CAPS_DEVICE_VGA -device VGA
QEMU_CAPS_DEVICE_CIRRUS_VGA -device cirrus-vga
QEMU_CAPS_DEVICE_VMWARE_SVGA -device vmware-svga
Fix a typo in qemuCapsObjectTypes, the string 'qxl' here
should be -device qxl rather than -vga [...|qxl|..]
---
src/qemu/qemu_capabilities.c | 10 ++++++++-
src/qemu/qemu_capabilities.h | 4 ++++
tests/qemuhelptest.c | 48 +++++++++++++++++++++++++++++++++++---------
3 files changed, 52 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 01a1b98..97bc968 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -194,6 +194,11 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
"usb-redir.bootindex",
"usb-host.bootindex",
"blockdev-snapshot-sync",
+ "qxl",
+
+ "VGA", /* 200 */
+ "cirrus-vga",
+ "vmware-svga",
);
struct _qemuCaps {
@@ -1322,11 +1327,14 @@ struct qemuCapsStringFlags qemuCapsObjectTypes[] = {
{ "virtio-scsi-pci", QEMU_CAPS_VIRTIO_SCSI_PCI },
{ "spicevmc", QEMU_CAPS_DEVICE_SPICEVMC },
{ "qxl-vga", QEMU_CAPS_DEVICE_QXL_VGA },
- { "qxl", QEMU_CAPS_VGA_QXL },
+ { "qxl", QEMU_CAPS_DEVICE_QXL },
{ "sga", QEMU_CAPS_SGA },
{ "scsi-block", QEMU_CAPS_SCSI_BLOCK },
{ "scsi-cd", QEMU_CAPS_SCSI_CD },
{ "ide-cd", QEMU_CAPS_IDE_CD },
+ { "VGA", QEMU_CAPS_DEVICE_VGA },
+ { "cirrus-vga", QEMU_CAPS_DEVICE_CIRRUS_VGA },
+ { "vmware-svga", QEMU_CAPS_DEVICE_VMWARE_SVGA },
};
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 3da8672..28604ce 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -156,6 +156,10 @@ enum qemuCapsFlags {
QEMU_CAPS_USB_REDIR_BOOTINDEX = 116, /* usb-redir.bootindex */
QEMU_CAPS_USB_HOST_BOOTINDEX = 117, /* usb-host.bootindex */
QEMU_CAPS_DISK_SNAPSHOT = 118, /* blockdev-snapshot-sync command */
+ QEMU_CAPS_DEVICE_QXL = 119, /* -device qxl */
+ QEMU_CAPS_DEVICE_VGA = 120, /* -device VGA */
+ QEMU_CAPS_DEVICE_CIRRUS_VGA = 121, /* -device cirrus-vga */
+ QEMU_CAPS_DEVICE_VMWARE_SVGA = 122, /* -device vmware-svga */
QEMU_CAPS_LAST, /* this must always be the last item */
};
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 021b3dc..2280f2d 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -391,7 +391,11 @@ mymain(void)
QEMU_CAPS_NO_ACPI,
QEMU_CAPS_VIRTIO_BLK_SG_IO,
QEMU_CAPS_CPU_HOST,
- QEMU_CAPS_VNC);
+ QEMU_CAPS_VNC,
+ QEMU_CAPS_DEVICE_QXL,
+ QEMU_CAPS_DEVICE_VGA,
+ QEMU_CAPS_DEVICE_CIRRUS_VGA,
+ QEMU_CAPS_DEVICE_VMWARE_SVGA);
DO_TEST("qemu-kvm-0.12.3", 12003, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -477,7 +481,6 @@ mymain(void)
QEMU_CAPS_NESTING,
QEMU_CAPS_NAME_PROCESS,
QEMU_CAPS_SMBIOS_TYPE,
- QEMU_CAPS_VGA_QXL,
QEMU_CAPS_SPICE,
QEMU_CAPS_VGA_NONE,
QEMU_CAPS_MIGRATE_QEMU_FD,
@@ -495,7 +498,11 @@ mymain(void)
QEMU_CAPS_VIRTIO_BLK_SG_IO,
QEMU_CAPS_CPU_HOST,
QEMU_CAPS_SCSI_LSI,
- QEMU_CAPS_VNC);
+ QEMU_CAPS_VNC,
+ QEMU_CAPS_DEVICE_QXL,
+ QEMU_CAPS_DEVICE_VGA,
+ QEMU_CAPS_DEVICE_CIRRUS_VGA,
+ QEMU_CAPS_DEVICE_VMWARE_SVGA);
DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -554,7 +561,11 @@ mymain(void)
QEMU_CAPS_VIRTIO_BLK_SG_IO,
QEMU_CAPS_CPU_HOST,
QEMU_CAPS_BLOCKIO,
- QEMU_CAPS_VNC);
+ QEMU_CAPS_VNC,
+ QEMU_CAPS_DEVICE_QXL,
+ QEMU_CAPS_DEVICE_VGA,
+ QEMU_CAPS_DEVICE_CIRRUS_VGA,
+ QEMU_CAPS_DEVICE_VMWARE_SVGA);
DO_TEST("qemu-kvm-0.12.1.2-rhel62-beta", 12001, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -623,7 +634,10 @@ mymain(void)
QEMU_CAPS_CPU_HOST,
QEMU_CAPS_SCSI_CD,
QEMU_CAPS_BLOCKIO,
- QEMU_CAPS_VNC);
+ QEMU_CAPS_VNC,
+ QEMU_CAPS_DEVICE_QXL,
+ QEMU_CAPS_DEVICE_VGA,
+ QEMU_CAPS_DEVICE_CIRRUS_VGA);
DO_TEST("qemu-1.0", 1000000, 0, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -697,7 +711,11 @@ mymain(void)
QEMU_CAPS_IDE_CD,
QEMU_CAPS_SCSI_LSI,
QEMU_CAPS_BLOCKIO,
- QEMU_CAPS_VNC);
+ QEMU_CAPS_VNC,
+ QEMU_CAPS_DEVICE_QXL,
+ QEMU_CAPS_DEVICE_VGA,
+ QEMU_CAPS_DEVICE_CIRRUS_VGA,
+ QEMU_CAPS_DEVICE_VMWARE_SVGA);
DO_TEST("qemu-1.1.0", 1001000, 0, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -779,7 +797,11 @@ mymain(void)
QEMU_CAPS_SCSI_LSI,
QEMU_CAPS_VIRTIO_SCSI_PCI,
QEMU_CAPS_BLOCKIO,
- QEMU_CAPS_VNC);
+ QEMU_CAPS_VNC,
+ QEMU_CAPS_DEVICE_QXL,
+ QEMU_CAPS_DEVICE_VGA,
+ QEMU_CAPS_DEVICE_CIRRUS_VGA,
+ QEMU_CAPS_DEVICE_VMWARE_SVGA);
DO_TEST("qemu-1.2.0", 1002000, 0, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -871,7 +893,11 @@ mymain(void)
QEMU_CAPS_DUMP_GUEST_CORE,
QEMU_CAPS_VNC,
QEMU_CAPS_USB_REDIR_BOOTINDEX,
- QEMU_CAPS_USB_HOST_BOOTINDEX);
+ QEMU_CAPS_USB_HOST_BOOTINDEX,
+ QEMU_CAPS_DEVICE_QXL,
+ QEMU_CAPS_DEVICE_VGA,
+ QEMU_CAPS_DEVICE_CIRRUS_VGA,
+ QEMU_CAPS_DEVICE_VMWARE_SVGA);
DO_TEST("qemu-kvm-1.2.0", 1002000, 1, 0,
QEMU_CAPS_VNC_COLON,
QEMU_CAPS_NO_REBOOT,
@@ -968,7 +994,11 @@ mymain(void)
QEMU_CAPS_DUMP_GUEST_CORE,
QEMU_CAPS_VNC,
QEMU_CAPS_USB_REDIR_BOOTINDEX,
- QEMU_CAPS_USB_HOST_BOOTINDEX);
+ QEMU_CAPS_USB_HOST_BOOTINDEX,
+ QEMU_CAPS_DEVICE_QXL,
+ QEMU_CAPS_DEVICE_VGA,
+ QEMU_CAPS_DEVICE_CIRRUS_VGA,
+ QEMU_CAPS_DEVICE_VMWARE_SVGA);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
--
1.7.11.2
12 years, 1 month
[libvirt] [PATCHv2 0/3] sysinfo: s390 bug fix and tests
by Viktor Mihajlovski
Another 'small' patch that developed into a series, hence the
v2 denomination.
Primarily this fixes a memory issue in virSysinfoRead on s390.
As a side effect it became necessary to work around a GCC
bug.
Finally I have followed Daniel Berrange's suggestion to provide
tests for sysinfo.
Viktor Mihajlovski (3):
build: Check for broken GCC -Wlogical-op in configure
S390: Fix virSysinfoRead memory corruption
tests: Add tests for sysinfo
cfg.mk | 2 +-
configure.ac | 23 ++++
src/libvirt_private.syms | 1 +
src/util/sysinfo.c | 192 +++++++++++++++++----------------
tests/Makefile.am | 6 ++
tests/sysinfodata/dmidecode.sh | 3 +
tests/sysinfodata/s390cpuinfo.data | 12 +++
tests/sysinfodata/s390sysinfo.data | 114 ++++++++++++++++++++
tests/sysinfodata/s390sysinfo.expect | 25 +++++
tests/sysinfodata/x86sysinfo.data | 83 +++++++++++++++
tests/sysinfodata/x86sysinfo.expect | 53 ++++++++++
tests/sysinfotest.c | 200 +++++++++++++++++++++++++++++++++++
12 files changed, 619 insertions(+), 95 deletions(-)
create mode 100755 tests/sysinfodata/dmidecode.sh
create mode 100644 tests/sysinfodata/s390cpuinfo.data
create mode 100644 tests/sysinfodata/s390sysinfo.data
create mode 100644 tests/sysinfodata/s390sysinfo.expect
create mode 100644 tests/sysinfodata/x86sysinfo.data
create mode 100644 tests/sysinfodata/x86sysinfo.expect
create mode 100644 tests/sysinfotest.c
--
1.7.12.4
12 years, 1 month
[libvirt] [PATCH] Revert "dnsmasq: Fix parsing of the version number"
by Michal Privoznik
This reverts commit 5114431396fd125b6ebe4d1a20a981111f948ee7
which was pushed accidentally.
---
Sorry for the inconvenience.
src/util/dnsmasq.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/util/dnsmasq.c b/src/util/dnsmasq.c
index a627ed2..bee3b61 100644
--- a/src/util/dnsmasq.c
+++ b/src/util/dnsmasq.c
@@ -641,9 +641,9 @@ dnsmasqCapsSetFromBuffer(dnsmasqCapsPtr caps, const char *buf)
caps->noRefresh = true;
- if (!(p = strstr(buf, DNSMASQ_VERSION_STR)))
+ p = STRSKIP(buf, DNSMASQ_VERSION_STR);
+ if (!p)
goto fail;
- p += sizeof(DNSMASQ_VERSION_STR) - 1;
virSkipSpaces(&p);
if (virParseVersionString(p, &caps->version, true) < 0)
goto fail;
--
1.7.8.6
12 years, 1 month
[libvirt] [PATCH 0/4] qemu: Refactor ManagedSave code and fix error reporting
by Peter Krempa
This series improves helpers to retrieve domain objects from
virDomainPtrs and uses the improvements in the ManagedSave APIs.
This series also fixes a bug in error reporting of qemuDomainManagedSaveRemove
where if unlink() failed no error was reported but an error code was returned.
Although there's a slight net increase of number of lines by this patch, it's
mainly due to the docs added in 1/4
Peter Krempa (4):
qemu: Add a new domain lookup helper and improve the docs
qemu: Refactor managed save functions to use domain lookup helpers
qemu: Small code cleanups in the managedsave functions
qemu: Improve error reporting from qemuDomainManagedSaveRemove
src/qemu/qemu_driver.c | 115 +++++++++++++++++++++++++++----------------------
1 file changed, 63 insertions(+), 52 deletions(-)
--
1.8.0
12 years, 1 month