[libvirt] PATCH: Fix libvirtd autostart for test driver
by Daniel P. Berrange
Ensure test:/// URIs get routed to the non-privileged libvirtd
* src/remote_internal.c: Ensure that all test:/// URIs are dealt
with by the auto-started, per-user unprivileged libvirtd instances
diff --git a/src/remote_internal.c b/src/remote_internal.c
index 91e111e..e661daa 100644
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -994,7 +994,8 @@ remoteOpen (virConnectPtr conn,
conn->uri->scheme &&
((strchr(conn->uri->scheme, '+') == 0)||
(strstr(conn->uri->scheme, "+unix") != NULL)) &&
- STREQ(conn->uri->path, "/session") &&
+ (STREQ(conn->uri->path, "/session") ||
+ STRPREFIX(conn->uri->scheme, "test+")) &&
getuid() > 0) {
DEBUG0("Auto-spawn user daemon instance");
rflags |= VIR_DRV_OPEN_REMOTE_USER;
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
15 years, 4 months
[libvirt] PATCH: Fix bug in error reporting for security driver
by Daniel P. Berrange
There are a couple more bugs in the security driver error reporting
code
- The remote daemon driver was formatting a generic string error, instead
of sending back the actual libvirt error
- The public interface was not raising a full error, nor copying the error
from the connection to the global error object
Daniel
diff -rup libvirt-0.6.3/qemud/remote.c libvirt-0.6.3.new/qemud/remote.c
--- libvirt-0.6.3/qemud/remote.c 2009-04-24 09:12:05.000000000 -0400
+++ libvirt-0.6.3.new/qemud/remote.c 2009-07-13 06:30:02.000000000 -0400
@@ -1366,7 +1366,7 @@ remoteDispatchDomainGetSecurityLabel(str
memset(&seclabel, 0, sizeof seclabel);
if (virDomainGetSecurityLabel(dom, &seclabel) == -1) {
virDomainFree(dom);
- remoteDispatchFormatError(rerr, "%s", _("unable to get security label"));
+ remoteDispatchConnError(rerr, conn);
return -1;
}
@@ -1395,7 +1395,7 @@ remoteDispatchNodeGetSecurityModel(struc
memset(&secmodel, 0, sizeof secmodel);
if (virNodeGetSecurityModel(conn, &secmodel) == -1) {
- remoteDispatchFormatError(rerr, "%s", _("unable to get security model"));
+ remoteDispatchConnError(rerr, conn);
return -1;
}
diff -rup libvirt-0.6.3/src/libvirt.c libvirt-0.6.3.new/src/libvirt.c
--- libvirt-0.6.3/src/libvirt.c 2009-07-13 06:31:29.000000000 -0400
+++ libvirt-0.6.3.new/src/libvirt.c 2009-07-13 06:27:42.000000000 -0400
@@ -4212,15 +4212,24 @@ virDomainGetSecurityLabel(virDomainPtr d
if (seclabel == NULL) {
virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
- return -1;
+ goto error;
}
conn = domain->conn;
- if (conn->driver->domainGetSecurityLabel)
- return conn->driver->domainGetSecurityLabel(domain, seclabel);
+ if (conn->driver->domainGetSecurityLabel) {
+ int ret;
+ ret = conn->driver->domainGetSecurityLabel(domain, seclabel);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
- virLibConnWarning(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+ /* Copy to connection error object for back compatability */
+ virSetConnError(domain->conn);
return -1;
}
@@ -4245,13 +4254,22 @@ virNodeGetSecurityModel(virConnectPtr co
if (secmodel == NULL) {
virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
- return -1;
+ goto error;
+ }
+
+ if (conn->driver->nodeGetSecurityModel) {
+ int ret;
+ ret = conn->driver->nodeGetSecurityModel(conn, secmodel);
+ if (ret < 0)
+ goto error;
+ return ret;
}
- if (conn->driver->nodeGetSecurityModel)
- return conn->driver->nodeGetSecurityModel(conn, secmodel);
+ virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
- virLibConnWarning(conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+ /* Copy to connection error object for back compatability */
+ virSetConnError(conn);
return -1;
}
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
15 years, 4 months
[libvirt] virsh migrate with libvirt-0.5.1: failed to start listening VM
by Jakub Hrozek
Hello,
I was trying to migrate a KVM/QEMU VM running on a Fedora 10 host to
another F10 host. Both machines have identical architectures (x86_64)
and are running identical versions of libvirt and KVM
(libvirt-0.5.1-2.fc10.x86_64, kvm-74-10.fc10.x86_64). However, the
migration fails:
# virsh migrate jhrozek-f11-minimal
qemu+ssh://someothersystem.example.com/system
libvir: QEMU error : operation failed: failed to start listening VM
On the target host, the logfile
/var/log/libvirt/qemu/jhrozek-f11-minimal.log says:
qemu: could not open disk image /var/lib/libvirt/images/jhrozek-f11-minimal.img
Which seems rather odd, isn't libvirt supposed to copy the image file?
Is this supposed to work? Is there any way to debug the problem? I
skimmed through RH Bugzilla and googled a bit but haven't found much
clue.
Help is appreciated,
Jakub
15 years, 4 months
[libvirt] Fedora Virtualization ... some comments and a request for help
by Gene Czarcinski
First some background ...
For the last two to three weeks, I have been working with Fedora (Linux)
virtualization ... specifically qemu/kvm. I have been a long time user of
VMware and and am hoping to migrate to Fedora Virtualization ("to change my
problem set").
I have successfully installed and run CentOS 5.3, Fedora 9, and Fedora 11 in
both i386 and x86_64 flavors. I have also installed and run Win2k PRO. All of
this worked just fine. Mostly I used virt-manager and only resorted to
command-line software when there was no alternative.
While I initially had some problems with the way sVirt was doing things, I
installed the preview set of packages (libvirt 0.6.5, etc) and it is mostly
"good enough" [I did find one "bug" which has been bugzillaed].
Now my problem!
I am not sure if I am trying to do something which currently cannot be done,
if I have found one or more bugs, or if I just need some help to point me in
the right direction.
I am trying to "migrate" some VMware guests over to qemu-kvm. I have tried
Win2k guests, F9 guests, and F11 guests. Because I sense that the HW version
of the disk images may be a problem, I made sure that all of the disk images
were version 3 or 4. Using vmware-vdiskmanager, I converted any "split disks"
into a single file.
I tried using the vmdk files from wmare. I tried converting the files (using
qemu-img) to both qcow2 and raw format. I tried using partimage-ng to save
(on vmware) and then restore (on qemu-kvm) the disk images.
Nothing works!
For Win2k, the guest system starts booting and then I get a host system kernel
oops. I also tried Win2k with qemu only (no kvm) ... the system started
booting and then rebooted ... endlessly.
For Fedora guests with LVM, grub brings in the kernel but then immediately
fails because it cannot find the logical volumes. For Fedora guests with just
/boot, swap, and / partitions, they fail after grub loads the kernel because
(IIRC) "setuproot" fails ... it cannot find the root partition.
I examined all of the virtual disk images that failed with guestfish and they
all looked OK. I also attached some of these virtual disks and booted up
under the rescue mode of the distribution DVD and the disks looked OK there
too.
BUT nothing worked!
Then I ran some tests with guests created under qemu-kvm. I created a small
guest by installing F11 on a SCSI drive (after doing a dance to swap things
around). This scsi install installed and ran fine.
I then took the disk image file and attached it to another guest as an IDE
drive! This booted up and ran fine.
Finally, I used partimage-ng to save the disk image originally created as SCSI
and restored it to a different ide attached disk image ... this also booted up
and ran fine.
There is documentation out there (some, not a lot) which says that I should be
able to "migrate" guests from VMware to qemu-kvm. For example:
http://www.linux-kvm.org/page/How_To_Migrate_From_Vmware_To_KVM
[I tried the above procedure, it did not work either]
What am I doing wrong???
Any hints (let alone outright explanations) will be appreciated.
BTW, there are statements that only vmdk version 3 and 4 formats ware
supported. If that is true, why are there error messages issued when a vmdk
file is processed which is not version 3 or 4?
Gene
15 years, 4 months
[libvirt] [PATCH] fix generation of .git-submodule-status
by Paolo Bonzini
When the .gnulib submodule is not initialized, "git submodule status"
will prepend a dash in front of the submodule's SHA1. Currently,
autogen.sh will then write the dashed SHA1 to its control file
.git-submodule-status.
This patch fixes the problem; the solution is to...
* autogen.sh: Reinvoke git submodule status after bootstrap has
initialized the submodule.
---
autogen.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index 415f3ec..c824a06 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -62,7 +62,7 @@ if test "$t" = "$(cat $curr_status 2>/dev/null)"; then
: # good, it's up to date
else
echo running bootstrap...
- ./bootstrap && echo "$t" > $curr_status
+ ./bootstrap && git submodule status > $curr_status
fi
# Automake requires that ChangeLog exist.
--
1.6.2.5
15 years, 4 months
[libvirt] Can not shutdown and reboot KVM virtual machine
by Zhang Qian
Hi,
I found I can not shutdown and reboot VMs in my KVM box.
It seems I can shutdown a VM which has guest OS installed, but can not
shutdown the VM which has no guest OS installed.
Reboot can not work with this error message:
this function is not supported by the hypervisor: virDomainReboot
Any ideas? Thanks!
I am using libvirt-0.6.4 and KVM-86.
Regards,
Qian
15 years, 4 months
[libvirt] Moving Drivers to their respective directories under src/
by Pritesh Kothari
Hi All,
Now since we have moved the repo from CVS => git can we consider moving each
driver to its respective directory under src/. The src/ directory is too
crowded with more then 150+ base files and more when you compile things.
Also is there any way to output the compiled files to a separate out directory
instead of keeping everything under src/. That would be advantages in two ways
mainly one by reducing the entries in .gitignore (will be just out directory)
and secondly will reduce the clutter by keeping src and output separate.
Regards,
Pritesh
15 years, 4 months
[libvirt] [PATCH] Link to libvirt tickets on the Red Hat Bugzilla Server
by Garry Dolley
General tickets are under the 'Virtualization Tools' product category and
Fedora specific tickets are under the 'Fedora' product category.
The component is 'libvirt' in both cases.
Signed-off-by: Garry Dolley <gdolley(a)ucla.edu>
---
docs/bugs.html | 4 ++--
docs/bugs.html.in | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/bugs.html b/docs/bugs.html
index b321505..55bcc2c 100644
--- a/docs/bugs.html
+++ b/docs/bugs.html
@@ -83,13 +83,13 @@
the <code>Virtualization Tools</code> product and the <code>libvirt</code>
component.
</p>
- <ul><li><a href="">View libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%...">New libvirt ticket</a></li></ul>
+ <ul><li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Virt...">View libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%...">New libvirt ticket</a></li></ul>
<h2>Linux Distribution specific bug reports</h2>
<ul><li>
If you are using official binaries from a <strong>Fedora distribution</strong>, enter
tickets against the <code>Fedora</code> product and the <code>libvirt</code>
component.
- <ul><li><a href="">View Fedora libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&comp...">New Fedora libvirt ticket</a></li></ul></li><li>
+ <ul><li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Fedora">View Fedora libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&comp...">New Fedora libvirt ticket</a></li></ul></li><li>
If you are using official binaries from <strong>Red Hat Enterprise Linux distribution</strong>,
tickets against the <code>Red Hat Enterprise Linux 5</code> product and
the <code>libvirt</code> component.
diff --git a/docs/bugs.html.in b/docs/bugs.html.in
index 0eb723a..df26c15 100644
--- a/docs/bugs.html.in
+++ b/docs/bugs.html.in
@@ -23,7 +23,7 @@
</p>
<ul>
- <li><a href="">View libvirt tickets</a></li>
+ <li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Virt...">View libvirt tickets</a></li>
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%...">New libvirt ticket</a></li>
</ul>
@@ -34,7 +34,7 @@
tickets against the <code>Fedora</code> product and the <code>libvirt</code>
component.
<ul>
- <li><a href="">View Fedora libvirt tickets</a></li>
+ <li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Fedora">View Fedora libvirt tickets</a></li>
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&comp...">New Fedora libvirt ticket</a></li>
</ul>
</li>
--
1.6.3.1
15 years, 4 months
[libvirt] PATCH 1/2: Support <video> element in domain config
by Daniel P. Berrange
This patch implements the basic domain config support for a <video>
element as per
http://www.redhat.com/archives/libvir-list/2009-May/msg00424.html
Since last time this
- Centralized the logic for default video model & default RAM
- Added a type=vbox for their custom graphics card
Daniel
From: Daniel P. Berrange <berrange(a)redhat.com>
Date: Mon, 6 Jul 2009 14:54:44 +0100
Subject: [PATCH 1/3] Support <video> tag for defining VGA card properties
* docs/schemas/domain.rng: Define <video> element schema
* src/domain_conf.c, src/domain_conf.h, src/libvirt_private.syms:
Add parsing and formatting for <video> element
---
docs/schemas/domain.rng | 34 +++++++
src/domain_conf.c | 225 ++++++++++++++++++++++++++++++++++++++++++++++
src/domain_conf.h | 29 ++++++
src/libvirt_private.syms | 5 +
4 files changed, 293 insertions(+), 0 deletions(-)
diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index 11cf04a..f857301 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -786,6 +786,39 @@
</element>
</define>
<!--
+ A graphic description, currently in Xen only 2 types are supported:
+ - sdl with optional display, xauth and fullscreen
+ - vnc with a required port and optional listen IP address, password
+ and keymap
+ -->
+ <define name="video">
+ <element name="video">
+ <optional>
+ <element name="model">
+ <attribute name="type">
+ <choice>
+ <value>vga</value>
+ <value>cirrus</value>
+ <value>vmvga</value>
+ <value>xen</value>
+ <value>vbox</value>
+ </choice>
+ </attribute>
+ <optional>
+ <attribute name="vram">
+ <ref name="unsignedInt"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="heads">
+ <ref name="unsignedInt"/>
+ </attribute>
+ </optional>
+ </element>
+ </optional>
+ </element>
+ </define>
+ <!--
When a domain terminates multiple policies can be applied depending
on how it ended:
-->
@@ -1032,6 +1065,7 @@
<ref name="sound"/>
<ref name="hostdev"/>
<ref name="graphic"/>
+ <ref name="video"/>
<ref name="console"/>
<ref name="parallel"/>
<ref name="serial"/>
diff --git a/src/domain_conf.c b/src/domain_conf.c
index ffa2aef..cc8c3ef 100644
--- a/src/domain_conf.c
+++ b/src/domain_conf.c
@@ -82,6 +82,7 @@ VIR_ENUM_IMPL(virDomainDevice, VIR_DOMAIN_DEVICE_LAST,
"interface",
"input",
"sound",
+ "video",
"hostdev")
VIR_ENUM_IMPL(virDomainDisk, VIR_DOMAIN_DISK_TYPE_LAST,
@@ -142,6 +143,13 @@ VIR_ENUM_IMPL(virDomainSoundModel, VIR_DOMAIN_SOUND_MODEL_LAST,
"pcspk",
"ac97")
+VIR_ENUM_IMPL(virDomainVideo, VIR_DOMAIN_VIDEO_TYPE_LAST,
+ "vga",
+ "cirrus",
+ "vmvga",
+ "xen",
+ "vbox")
+
VIR_ENUM_IMPL(virDomainInput, VIR_DOMAIN_INPUT_TYPE_LAST,
"mouse",
"tablet")
@@ -374,6 +382,14 @@ void virDomainSoundDefFree(virDomainSoundDefPtr def)
VIR_FREE(def);
}
+void virDomainVideoDefFree(virDomainVideoDefPtr def)
+{
+ if (!def)
+ return;
+
+ VIR_FREE(def);
+}
+
void virDomainHostdevDefFree(virDomainHostdevDefPtr def)
{
if (!def)
@@ -401,6 +417,9 @@ void virDomainDeviceDefFree(virDomainDeviceDefPtr def)
case VIR_DOMAIN_DEVICE_SOUND:
virDomainSoundDefFree(def->data.sound);
break;
+ case VIR_DOMAIN_DEVICE_VIDEO:
+ virDomainVideoDefFree(def->data.video);
+ break;
case VIR_DOMAIN_DEVICE_HOSTDEV:
virDomainHostdevDefFree(def->data.hostdev);
break;
@@ -458,6 +477,10 @@ void virDomainDefFree(virDomainDefPtr def)
virDomainSoundDefFree(def->sounds[i]);
VIR_FREE(def->sounds);
+ for (i = 0 ; i < def->nvideos ; i++)
+ virDomainVideoDefFree(def->videos[i]);
+ VIR_FREE(def->videos);
+
for (i = 0 ; i < def->nhostdevs ; i++)
virDomainHostdevDefFree(def->hostdevs[i]);
VIR_FREE(def->hostdevs);
@@ -1653,6 +1676,133 @@ error:
goto cleanup;
}
+
+int
+virDomainVideoDefaultRAM(virDomainDefPtr def,
+ int type)
+{
+ switch (type) {
+ /* Wierd, QEMU defaults to 9 MB ??! */
+ case VIR_DOMAIN_VIDEO_TYPE_VGA:
+ case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
+ case VIR_DOMAIN_VIDEO_TYPE_VMVGA:
+ if (def->virtType == VIR_DOMAIN_VIRT_VBOX)
+ return 8 * 1024;
+ else
+ return 9 * 1024;
+ break;
+
+ case VIR_DOMAIN_VIDEO_TYPE_XEN:
+ /* Original Xen PVFB hardcoded to 4 MB */
+ return 4 * 1024;
+
+ default:
+ return 0;
+ }
+}
+
+
+int
+virDomainVideoDefaultType(virDomainDefPtr def)
+{
+ switch (def->virtType) {
+ case VIR_DOMAIN_VIRT_TEST:
+ case VIR_DOMAIN_VIRT_QEMU:
+ case VIR_DOMAIN_VIRT_KQEMU:
+ case VIR_DOMAIN_VIRT_KVM:
+ case VIR_DOMAIN_VIRT_XEN:
+ if (def->os.type &&
+ (STREQ(def->os.type, "xen") ||
+ STREQ(def->os.type, "linux")))
+ return VIR_DOMAIN_VIDEO_TYPE_XEN;
+ else
+ return VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
+
+ case VIR_DOMAIN_VIRT_VBOX:
+ return VIR_DOMAIN_VIDEO_TYPE_VBOX;
+
+ default:
+ return -1;
+ }
+}
+
+static virDomainVideoDefPtr
+virDomainVideoDefParseXML(virConnectPtr conn,
+ const xmlNodePtr node,
+ virDomainDefPtr dom,
+ int flags ATTRIBUTE_UNUSED) {
+ virDomainVideoDefPtr def;
+ xmlNodePtr cur;
+ char *type = NULL;
+ char *heads = NULL;
+ char *vram = NULL;
+
+ if (VIR_ALLOC(def) < 0) {
+ virReportOOMError(conn);
+ return NULL;
+ }
+
+ cur = node->children;
+ while (cur != NULL) {
+ if (cur->type == XML_ELEMENT_NODE) {
+ if ((type == NULL) && (vram == NULL) && (heads == NULL) &&
+ xmlStrEqual(cur->name, BAD_CAST "model")) {
+ type = virXMLPropString(cur, "type");
+ vram = virXMLPropString(cur, "vram");
+ heads = virXMLPropString(cur, "heads");
+ }
+ }
+ cur = cur->next;
+ }
+
+ if (type) {
+ if ((def->type = virDomainVideoTypeFromString(type)) < 0) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("unknown video model '%s'"), type);
+ goto error;
+ }
+ } else {
+ if ((def->type = virDomainVideoDefaultType(dom)) < 0) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+ _("missing video model and cannot determine default"));
+ goto error;
+ }
+ }
+
+ if (vram) {
+ if (virStrToLong_ui(vram, NULL, 10, &def->vram) < 0) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse video ram '%s'"), vram);
+ goto error;
+ }
+ } else {
+ def->vram = virDomainVideoDefaultRAM(dom, def->type);
+ }
+
+ if (heads) {
+ if (virStrToLong_ui(heads, NULL, 10, &def->heads) < 0) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse video heads '%s'"), heads);
+ goto error;
+ }
+ } else {
+ def->heads = 1;
+ }
+
+ VIR_FREE(type);
+ VIR_FREE(vram);
+ VIR_FREE(heads);
+
+ return def;
+
+error:
+ virDomainVideoDefFree(def);
+ VIR_FREE(type);
+ VIR_FREE(vram);
+ VIR_FREE(heads);
+ return NULL;
+}
+
static int
virDomainHostdevSubsysUsbDefParseXML(virConnectPtr conn,
const xmlNodePtr node,
@@ -2091,6 +2241,10 @@ virDomainDeviceDefPtr virDomainDeviceDefParse(virConnectPtr conn,
dev->type = VIR_DOMAIN_DEVICE_SOUND;
if (!(dev->data.sound = virDomainSoundDefParseXML(conn, node, flags)))
goto error;
+ } else if (xmlStrEqual(node->name, BAD_CAST "video")) {
+ dev->type = VIR_DOMAIN_DEVICE_VIDEO;
+ if (!(dev->data.video = virDomainVideoDefParseXML(conn, node, def, flags)))
+ goto error;
} else if (xmlStrEqual(node->name, BAD_CAST "hostdev")) {
dev->type = VIR_DOMAIN_DEVICE_HOSTDEV;
if (!(dev->data.hostdev = virDomainHostdevDefParseXML(conn, node, flags)))
@@ -2649,6 +2803,47 @@ static virDomainDefPtr virDomainDefParseXML(virConnectPtr conn,
}
VIR_FREE(nodes);
+ /* analysis of the video devices */
+ if ((n = virXPathNodeSet(conn, "./devices/video", ctxt, &nodes)) < 0) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("cannot extract video devices"));
+ goto error;
+ }
+ if (n && VIR_ALLOC_N(def->videos, n) < 0)
+ goto no_memory;
+ for (i = 0 ; i < n ; i++) {
+ virDomainVideoDefPtr video = virDomainVideoDefParseXML(conn,
+ nodes[i],
+ def,
+ flags);
+ if (!video)
+ goto error;
+ def->videos[def->nvideos++] = video;
+ }
+ VIR_FREE(nodes);
+
+ /* For backwards compatability, if no <video> tag is set but there
+ * is a <graphics> tag, then we add a single video tag */
+ if (def->ngraphics && !def->nvideos) {
+ virDomainVideoDefPtr video;
+ if (VIR_ALLOC(video) < 0)
+ goto no_memory;
+ video->type = virDomainVideoDefaultType(def);
+ if (video->type < 0) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot determine default video type"));
+ VIR_FREE(video);
+ goto error;
+ }
+ video->vram = virDomainVideoDefaultRAM(def, video->type);
+ video->heads = 1;
+ if (VIR_ALLOC_N(def->videos, 1) < 0) {
+ virDomainVideoDefFree(video);
+ goto no_memory;
+ }
+ def->videos[def->nvideos++] = video;
+ }
+
/* analysis of the host devices */
if ((n = virXPathNodeSet(conn, "./devices/hostdev", ctxt, &nodes)) < 0) {
virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
@@ -3486,6 +3681,32 @@ virDomainSoundDefFormat(virConnectPtr conn,
}
static int
+virDomainVideoDefFormat(virConnectPtr conn,
+ virBufferPtr buf,
+ virDomainVideoDefPtr def)
+{
+ const char *model = virDomainVideoTypeToString(def->type);
+
+ if (!model) {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("unexpected video model %d"), def->type);
+ return -1;
+ }
+
+ virBufferAddLit(buf, " <video>\n");
+ virBufferVSprintf(buf, " <model type='%s'",
+ model);
+ if (def->vram)
+ virBufferVSprintf(buf, " vram='%u'", def->vram);
+ if (def->heads)
+ virBufferVSprintf(buf, " heads='%u'", def->heads);
+ virBufferAddLit(buf, "/>\n");
+ virBufferAddLit(buf, " </video>\n");
+
+ return 0;
+}
+
+static int
virDomainInputDefFormat(virConnectPtr conn,
virBufferPtr buf,
virDomainInputDefPtr def)
@@ -3860,6 +4081,10 @@ char *virDomainDefFormat(virConnectPtr conn,
if (virDomainSoundDefFormat(conn, &buf, def->sounds[n]) < 0)
goto cleanup;
+ for (n = 0 ; n < def->nvideos ; n++)
+ if (virDomainVideoDefFormat(conn, &buf, def->videos[n]) < 0)
+ goto cleanup;
+
for (n = 0 ; n < def->nhostdevs ; n++)
if (virDomainHostdevDefFormat(conn, &buf, def->hostdevs[n]) < 0)
goto cleanup;
diff --git a/src/domain_conf.h b/src/domain_conf.h
index 51310c1..51dd6d3 100644
--- a/src/domain_conf.h
+++ b/src/domain_conf.h
@@ -265,6 +265,26 @@ struct _virDomainSoundDef {
int model;
};
+
+enum virDomainVideoType {
+ VIR_DOMAIN_VIDEO_TYPE_VGA,
+ VIR_DOMAIN_VIDEO_TYPE_CIRRUS,
+ VIR_DOMAIN_VIDEO_TYPE_VMVGA,
+ VIR_DOMAIN_VIDEO_TYPE_XEN,
+ VIR_DOMAIN_VIDEO_TYPE_VBOX,
+
+ VIR_DOMAIN_VIDEO_TYPE_LAST
+};
+
+
+typedef struct _virDomainVideoDef virDomainVideoDef;
+typedef virDomainVideoDef *virDomainVideoDefPtr;
+struct _virDomainVideoDef {
+ int type;
+ unsigned int vram;
+ unsigned int heads;
+};
+
/* 3 possible graphics console modes */
enum virDomainGraphicsType {
VIR_DOMAIN_GRAPHICS_TYPE_SDL,
@@ -361,6 +381,7 @@ enum virDomainDeviceType {
VIR_DOMAIN_DEVICE_NET,
VIR_DOMAIN_DEVICE_INPUT,
VIR_DOMAIN_DEVICE_SOUND,
+ VIR_DOMAIN_DEVICE_VIDEO,
VIR_DOMAIN_DEVICE_HOSTDEV,
VIR_DOMAIN_DEVICE_LAST,
@@ -376,6 +397,7 @@ struct _virDomainDeviceDef {
virDomainNetDefPtr net;
virDomainInputDefPtr input;
virDomainSoundDefPtr sound;
+ virDomainVideoDefPtr video;
virDomainHostdevDefPtr hostdev;
} data;
};
@@ -492,6 +514,9 @@ struct _virDomainDef {
int nsounds;
virDomainSoundDefPtr *sounds;
+ int nvideos;
+ virDomainVideoDefPtr *videos;
+
int nhostdevs;
virDomainHostdevDefPtr *hostdevs;
@@ -557,6 +582,7 @@ void virDomainFSDefFree(virDomainFSDefPtr def);
void virDomainNetDefFree(virDomainNetDefPtr def);
void virDomainChrDefFree(virDomainChrDefPtr def);
void virDomainSoundDefFree(virDomainSoundDefPtr def);
+void virDomainVideoDefFree(virDomainVideoDefPtr def);
void virDomainHostdevDefFree(virDomainHostdevDefPtr def);
void virDomainDeviceDefFree(virDomainDeviceDefPtr def);
void virDomainDefFree(virDomainDefPtr vm);
@@ -666,6 +692,8 @@ int virDiskNameToBusDeviceIndex(virDomainDiskDefPtr disk,
int *devIdx);
virDomainFSDefPtr virDomainGetRootFilesystem(virDomainDefPtr def);
+int virDomainVideoDefaultType(virDomainDefPtr def);
+int virDomainVideoDefaultRAM(virDomainDefPtr def, int type);
void virDomainObjLock(virDomainObjPtr obj);
void virDomainObjUnlock(virDomainObjPtr obj);
@@ -683,6 +711,7 @@ VIR_ENUM_DECL(virDomainFS)
VIR_ENUM_DECL(virDomainNet)
VIR_ENUM_DECL(virDomainChr)
VIR_ENUM_DECL(virDomainSoundModel)
+VIR_ENUM_DECL(virDomainVideo)
VIR_ENUM_DECL(virDomainHostdevMode)
VIR_ENUM_DECL(virDomainHostdevSubsys)
VIR_ENUM_DECL(virDomainInput)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index bd7910b..d43620f 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -100,6 +100,11 @@ virDomainSaveStatus;
virDomainSoundDefFree;
virDomainSoundModelTypeFromString;
virDomainSoundModelTypeToString;
+virDomainVideoDefFree;
+virDomainVideoTypeToString;
+virDomainVideoTypeFromString;
+virDomainVideoDefaultRAM;
+virDomainVideoDefaultType;
virDomainVirtTypeToString;
virDomainFSDefFree;
virDomainObjLock;
--
1.6.2.5
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
15 years, 4 months
[libvirt] [PATCH] Link to libvirt tickets on the Red Hat Bugzilla Server
by Garry Dolley
General tickets are under the 'Virtualization Tools' product category and
Fedora specific tickets are under the 'Fedora' product category.
The component is 'libvirt' in both cases.
Signed-off-by: Garry Dolley <gdolley(a)ucla.edu>
---
docs/bugs.html | 4 ++--
docs/bugs.html.in | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/bugs.html b/docs/bugs.html
index b321505..55bcc2c 100644
--- a/docs/bugs.html
+++ b/docs/bugs.html
@@ -83,13 +83,13 @@
the <code>Virtualization Tools</code> product and the <code>libvirt</code>
component.
</p>
- <ul><li><a href="">View libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%...">New libvirt ticket</a></li></ul>
+ <ul><li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Virt...">View libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%...">New libvirt ticket</a></li></ul>
<h2>Linux Distribution specific bug reports</h2>
<ul><li>
If you are using official binaries from a <strong>Fedora distribution</strong>, enter
tickets against the <code>Fedora</code> product and the <code>libvirt</code>
component.
- <ul><li><a href="">View Fedora libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&comp...">New Fedora libvirt ticket</a></li></ul></li><li>
+ <ul><li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Fedora">View Fedora libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&comp...">New Fedora libvirt ticket</a></li></ul></li><li>
If you are using official binaries from <strong>Red Hat Enterprise Linux distribution</strong>,
tickets against the <code>Red Hat Enterprise Linux 5</code> product and
the <code>libvirt</code> component.
diff --git a/docs/bugs.html.in b/docs/bugs.html.in
index 0eb723a..df26c15 100644
--- a/docs/bugs.html.in
+++ b/docs/bugs.html.in
@@ -23,7 +23,7 @@
</p>
<ul>
- <li><a href="">View libvirt tickets</a></li>
+ <li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Virt...">View libvirt tickets</a></li>
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%...">New libvirt ticket</a></li>
</ul>
@@ -34,7 +34,7 @@
tickets against the <code>Fedora</code> product and the <code>libvirt</code>
component.
<ul>
- <li><a href="">View Fedora libvirt tickets</a></li>
+ <li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Fedora">View Fedora libvirt tickets</a></li>
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&comp...">New Fedora libvirt ticket</a></li>
</ul>
</li>
--
1.6.3.1
!DSPAM:4a5792d46141992511921!
15 years, 4 months