[libvirt] [PATCHv2] Renamed internal __mon_yday into mon_yday to avoid conflicts
by Cédric Bosdonnat
libc has another constant with the same name, which leads to
redefinition error when building against static libvirt
---
src/util/virtime.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/util/virtime.c b/src/util/virtime.c
index acbec41..9d365d5 100644
--- a/src/util/virtime.c
+++ b/src/util/virtime.c
@@ -105,7 +105,7 @@ int virTimeFieldsNowRaw(struct tm *fields)
#define DIV(a, b) ((a) / (b) - ((a) % (b) < 0))
#define LEAPS_THRU_END_OF(y) (DIV (y, 4) - DIV (y, 100) + DIV (y, 400))
-const unsigned short int __mon_yday[2][13] = {
+static const unsigned short int mon_yday[2][13] = {
/* Normal years. */
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
/* Leap years. */
@@ -160,7 +160,7 @@ void virTimeFieldsThen(unsigned long long when, struct tm *fields)
fields->tm_year = y - 1900;
fields->tm_yday = days;
- ip = __mon_yday[is_leap_year(y)];
+ ip = mon_yday[is_leap_year(y)];
for (y = 11; days < (long int) ip[y]; --y)
continue;
days -= ip[y];
--
1.8.4.5
10 years, 2 months
[libvirt] [PATCH] libxl: Drop driver lock in libxlDomainDefineXML
by Jim Fehlig
There is no need to acquire the driver-wide lock in
libxlDomainDefineXML. When switching to jobs in the libxl
driver, most driver-wide locks were removed. The locking here
was preserved since I mistakenly thought virDomainObjListAdd
needed protection. This is not the case, so remove the
unnecessary locking.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
src/libxl/libxl_driver.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 2f2c590..d4ecd62 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -2381,25 +2381,22 @@ libxlDomainDefineXML(virConnectPtr conn, const char *xml)
virObjectEventPtr event = NULL;
virDomainDefPtr oldDef = NULL;
- /* Lock the driver until the virDomainObj is created and locked */
- libxlDriverLock(driver);
if (!(def = virDomainDefParseString(xml, cfg->caps, driver->xmlopt,
1 << VIR_DOMAIN_VIRT_XEN,
VIR_DOMAIN_XML_INACTIVE)))
- goto cleanup_unlock;
+ goto cleanup;
if (virDomainDefineXMLEnsureACL(conn, def) < 0)
- goto cleanup_unlock;
+ goto cleanup;
if (!(vm = virDomainObjListAdd(driver->domains, def,
driver->xmlopt,
0,
&oldDef)))
- goto cleanup_unlock;
+ goto cleanup;
def = NULL;
vm->persistent = 1;
- libxlDriverUnlock(driver);
if (virDomainSaveConfig(cfg->configDir,
vm->newDef ? vm->newDef : vm->def) < 0) {
@@ -2426,10 +2423,6 @@ libxlDomainDefineXML(virConnectPtr conn, const char *xml)
libxlDomainEventQueue(driver, event);
virObjectUnref(cfg);
return dom;
-
- cleanup_unlock:
- libxlDriverUnlock(driver);
- goto cleanup;
}
static int
--
1.8.4.5
10 years, 2 months
[libvirt] [PATCH] libxl: Implement basic video device selection
by Stefan Bader
Re-pushing this as the old thread got rather stale. Some of the
VFB setup went in a bug fix. Not sure I missed a detail in rebasing
bug the keyboard setting may be the only thing missing...
-Stefan
[v2: Check return code of VIR_STRDUP and fix indentation]
[v3: Split out VRAM fixup and return error for unsupported video type]
[v4: Re-arrange code and move VFB setup into libxlMakeVfbList]
[v5: Rebased against head which already had some VFB setup code]
>From b3ff8f4c658d29f15e673af88b9ae2fdfa3c1317 Mon Sep 17 00:00:00 2001
From: Stefan Bader <stefan.bader(a)canonical.com>
Date: Thu, 27 Mar 2014 16:01:18 +0100
Subject: [PATCH] libxl: Implement basic video device selection
This started as an investigation into an issue where libvirt (using the
libxl driver) and the Xen host, like an old couple, could not agree on
who is responsible for selecting the VNC port to use.
Things usually (and a bit surprisingly) did work because, just like that
old couple, they had the same idea on what to do by default. However it
was possible that this ended up in a big argument.
The problem is that display information exists in two different places:
in the vfbs list and in the build info. And for launching the device model,
only the latter is used. But that never gets initialized from libvirt. So
Xen allows the device model to select a default port while libvirt thinks
it has told Xen that this is done by libvirt (though the vfbs config).
While fixing that, I made a stab at actually evaluating the configuration
of the video device. So that it is now possible to at least decide between
a Cirrus or standard VGA emulation and to modify the VRAM within certain
limits using libvirt.
Signed-off-by: Stefan Bader <stefan.bader(a)canonical.com>
---
src/libxl/libxl_conf.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index acba69c..2727230 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1200,6 +1200,8 @@ libxlMakeVfbList(virPortAllocatorPtr graphicsports,
if (VIR_STRDUP(b_info->u.hvm.sdl.xauthority, vfb.sdl.xauthority) < 0)
goto error;
}
+ if (VIR_STRDUP(b_info->u.hvm.keymap, vfb.keymap) < 0)
+ goto error;
}
return 0;
@@ -1462,6 +1464,45 @@ libxlMakeCapabilities(libxl_ctx *ctx)
return NULL;
}
+static int
+libxlMakeVideo(virDomainDefPtr def, libxl_domain_config *d_config)
+{
+ libxl_domain_build_info *b_info = &d_config->b_info;
+
+ if (d_config->c_info.type != LIBXL_DOMAIN_TYPE_HVM)
+ return 0;
+
+ /*
+ * Take the first defined video device (graphics card) to display
+ * on the first graphics device (display).
+ * Right now only type and vram info is used and anything beside
+ * type xen and vga is mapped to cirrus.
+ */
+ if (def->nvideos) {
+ switch (def->videos[0]->type) {
+ case VIR_DOMAIN_VIDEO_TYPE_VGA:
+ case VIR_DOMAIN_VIDEO_TYPE_XEN:
+ b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_STD;
+ break;
+ case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
+ b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
+ break;
+ default:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s",
+ _("video type not supported by libxl"));
+ return -1;
+ }
+ b_info->video_memkb = def->videos[0]->vram ?
+ def->videos[0]->vram :
+ LIBXL_MEMKB_DEFAULT;
+ } else {
+ libxl_defbool_set(&b_info->u.hvm.nographic, 1);
+ }
+
+ return 0;
+}
+
int
libxlBuildDomainConfig(virPortAllocatorPtr graphicsports,
virDomainDefPtr def,
@@ -1488,6 +1529,15 @@ libxlBuildDomainConfig(virPortAllocatorPtr graphicsports,
if (libxlMakePCIList(def, d_config) < 0)
return -1;
+ /*
+ * Now that any potential VFBs are defined, it is time to update the
+ * build info with the data of the primary display. Some day libxl
+ * might implicitely do so but as it does not right now, better be
+ * explicit.
+ */
+ if (libxlMakeVideo(def, d_config) < 0)
+ return -1;
+
d_config->on_reboot = libxlActionFromVirLifecycle(def->onReboot);
d_config->on_poweroff = libxlActionFromVirLifecycle(def->onPoweroff);
d_config->on_crash = libxlActionFromVirLifecycleCrash(def->onCrash);
--
1.9.1
10 years, 2 months
Re: [libvirt] Adding multiple graphics devices to a vm
by bancfc@openmailbox.org
Thanks that was it. Apparently Debian includes the package
xserver-xorg-video-qxl but doesn't have it setup/installed out of the
box. After I did this, I was able to get high resolutions with SPICE.
10 years, 2 months
[libvirt] [PATCH v2 0/5] Add "rawio" for hostdev
by John Ferlan
v1 is here:
http://www.redhat.com/archives/libvir-list/2014-September/msg00502.html
Changes since v1 (from code review):
* Insert patch 1 to insert a missing goto if rawio is set, but the
build doesn't suport CAP_SYS_RAWIO.
* Insert patch 2 to use the TristateBool for virDomainDiskDef and
the associated changes where it's used in code
* Patch 3, 4, 5: Use TristateBool for hostdev rawio and the virYesNo
in the rng
John Ferlan (5):
qemu: Add missing goto on rawio
domain_conf: Change virDomainDiskDef 'rawio' to use virTristateBool
hostdev: Add "rawio" attribute to _virDomainHostdevSubsysSCSI
qemu: Process the hostdev "rawio" setting
domain_conf: Process the "rawio" for a hostdev device
docs/formatdomain.html.in | 12 +++++--
docs/schemas/domaincommon.rng | 12 +++++--
src/conf/domain_conf.c | 40 +++++++++++++++-------
src/conf/domain_conf.h | 4 +--
src/qemu/qemu_domain.c | 23 +++++++++++--
src/qemu/qemu_domain.h | 4 +++
src/qemu/qemu_driver.c | 1 +
src/qemu/qemu_process.c | 23 ++++++++++++-
.../qemuxml2argv-hostdev-scsi-rawio.xml | 35 +++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
10 files changed, 132 insertions(+), 23 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-rawio.xml
--
1.9.3
10 years, 2 months
[libvirt] retiring v0.9.6-maint
by Eric Blake
Any objections to retiring the v0.9.6-maint branch? After all, we have
already retired the v0.9.11-maint branch
(http://libvirt.org/git/?p=libvirt.git;a=commit;h=cd0d348ed), and the
only activity on v0.9.6-maint since 0.9.6.4 was released in January 2013
was the backport of a single CVE fix. The branch no longer builds
cleanly on Fedora 20, and while I could identify patches to backport to
fix the build situation, it's not worth my time if we can just retire
the branch.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
10 years, 2 months
[libvirt] Adding multiple graphics devices to a vm
by bancfc@openmailbox.org
I was trying different video devices to correct the problem of having
1024x768 as the maximum resolution for Debian guests. I found out that
adding VMVGA gives the wide variety of choice of resolutions I was
looking for and adjusts the display properly, in contrast to the
deformed way xconf file did. However I still want to make use of SPICE
and QXL.
Is there a way to have both vmvga and qxl attached and working on the
same guest?
How would I go about doing this in the XML?
thanks.
10 years, 2 months
[libvirt] [PATCH 0/3] Add "rawio" for hostdev
by John Ferlan
The "rawio" setting for a <device.../> <disk.../> lun isn't duplicated
in the scsi_host hostdev device for a lun. Rather than "requiring" some
disk in the disk list to add the rawio, add the "rawio" property to
the scsi_host hostdev lun.
John Ferlan (3):
hostdev: Add "rawio" attribute to _virDomainHostdevSubsysSCSI
qemu: Process the hostdev "rawio" setting
domain_conf: Process the "rawio" for a hostdev device
docs/formatdomain.html.in | 12 ++++++--
docs/schemas/domaincommon.rng | 18 +++++++----
src/conf/domain_conf.c | 31 +++++++++++++++++++
src/conf/domain_conf.h | 2 ++
src/qemu/qemu_domain.c | 21 +++++++++++++
src/qemu/qemu_domain.h | 4 +++
src/qemu/qemu_driver.c | 1 +
src/qemu/qemu_process.c | 20 ++++++++++++-
.../qemuxml2argv-hostdev-scsi-rawio.xml | 35 ++++++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
10 files changed, 135 insertions(+), 10 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-rawio.xml
--
1.9.3
10 years, 2 months