[libvirt] [PATCH 1/2] Fix order of disks and controllers
by Jiri Denemark
Commit 2d6adabd53c8f1858191d521dc9b4948d1205955 replaced qsorting disk
and controller devices with inserting them at the right position. That
was to fix unnecessary reordering of devices. However, when parsing
domain XML devices are just taken in the order in which they appear in
the XML since. Use the correct insertion algorithm to honor device
target.
---
src/conf/domain_conf.c | 4 +-
.../qemuxml2argvdata/qemuxml2argv-boot-order.args | 35 ++++++++++++-------
tests/qemuxml2argvdata/qemuxml2argv-boot-order.xml | 14 ++++----
tests/xmconfigdata/test-escape-paths.cfg | 2 +-
tests/xmconfigdata/test-escape-paths.xml | 10 +++---
5 files changed, 37 insertions(+), 28 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b406202..48ed7eb 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5883,7 +5883,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
if (!disk)
goto error;
- def->disks[def->ndisks++] = disk;
+ virDomainDiskInsertPreAlloced(def, disk);
}
VIR_FREE(nodes);
@@ -5899,7 +5899,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
if (!controller)
goto error;
- def->controllers[def->ncontrollers++] = controller;
+ virDomainControllerInsertPreAlloced(def, controller);
}
VIR_FREE(nodes);
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-order.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-order.args
index 23249f3..14367b1 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-order.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-order.args
@@ -1,13 +1,22 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
-pc -m 214 -smp 1 -nographic -nodefaults -monitor unix:/tmp/test-monitor,server,\
-nowait -no-acpi -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-ide0-0-0 \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -drive \
-file=sheepdog:example.org:6000:image,if=none,id=drive-virtio-disk0 -device \
-virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,\
-bootindex=3 -drive file=/root/boot.iso,if=none,media=cdrom,id=drive-ide0-1-0 \
--device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,\
-bootindex=1 -drive file=/dev/null,if=none,id=drive-fdc0-0-1 -global \
-isa-fdc.driveB=drive-fdc0-0-1 -global isa-fdc.bootindexB=4 -device \
-virtio-net-pci,vlan=0,id=net0,mac=00:11:22:33:44:55,bus=pci.0,addr=0x3,\
-bootindex=2 -net user,vlan=0,name=hostnet0 -usb -device virtio-balloon-pci,\
-id=balloon0,bus=pci.0,addr=0x5
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu \
+-S \
+-M pc \
+-m 214 \
+-smp 1 \
+-nographic \
+-nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi \
+-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-ide0-0-0 \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-drive file=/root/boot.iso,if=none,media=cdrom,id=drive-ide0-1-0 \
+-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1 \
+-drive file=sheepdog:example.org:6000:image,if=none,id=drive-virtio-disk0 \
+-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=3 \
+-drive file=/dev/null,if=none,id=drive-fdc0-0-1 \
+-global isa-fdc.driveB=drive-fdc0-0-1 \
+-global isa-fdc.bootindexB=4 \
+-device virtio-net-pci,vlan=0,id=net0,mac=00:11:22:33:44:55,bus=pci.0,addr=0x3,bootindex=2 \
+-net user,vlan=0,name=hostnet0 \
+-usb \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-order.xml b/tests/qemuxml2argvdata/qemuxml2argv-boot-order.xml
index ba8a9b2..0022c92 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-order.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-order.xml
@@ -18,6 +18,13 @@
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
+ <disk type='file' device='cdrom'>
+ <source file='/root/boot.iso'/>
+ <target dev='hdc' bus='ide'/>
+ <boot order='1'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1' unit='0'/>
+ </disk>
<disk type='network' device='disk'>
<driver name='qemu' type='raw'/>
<source protocol='sheepdog' name='image'>
@@ -26,13 +33,6 @@
<target dev='vda' bus='virtio'/>
<boot order='3'/>
</disk>
- <disk type='file' device='cdrom'>
- <source file='/root/boot.iso'/>
- <target dev='hdc' bus='ide'/>
- <boot order='1'/>
- <readonly/>
- <address type='drive' controller='0' bus='1' unit='0'/>
- </disk>
<disk type='file' device='floppy'>
<driver name='qemu' type='raw'/>
<source file='/dev/null'/>
diff --git a/tests/xmconfigdata/test-escape-paths.cfg b/tests/xmconfigdata/test-escape-paths.cfg
index e3e6db9..13be2a0 100644
--- a/tests/xmconfigdata/test-escape-paths.cfg
+++ b/tests/xmconfigdata/test-escape-paths.cfg
@@ -19,7 +19,7 @@ vnc = 1
vncunused = 1
vnclisten = "127.0.0.1"
vncpasswd = "123poi"
-disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso&test,hdc:cdrom,r", """phy:/dev/HostVG/XenGuest'",hdb,w""" ]
+disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", """phy:/dev/HostVG/XenGuest'",hdb,w""", "file:/root/boot.iso&test,hdc:cdrom,r" ]
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000,type=ioemu" ]
parallel = "none"
serial = "none"
diff --git a/tests/xmconfigdata/test-escape-paths.xml b/tests/xmconfigdata/test-escape-paths.xml
index 13e6e29..9eaf90c 100644
--- a/tests/xmconfigdata/test-escape-paths.xml
+++ b/tests/xmconfigdata/test-escape-paths.xml
@@ -25,17 +25,17 @@
<source dev='/dev/HostVG/XenGuest2'/>
<target dev='hda' bus='ide'/>
</disk>
+ <disk type='block' device='disk'>
+ <driver name='phy'/>
+ <source dev='/dev/HostVG/XenGuest'"'/>
+ <target dev='hdb' bus='ide'/>
+ </disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso&test'/>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
- <disk type='block' device='disk'>
- <driver name='phy'/>
- <source dev='/dev/HostVG/XenGuest'"'/>
- <target dev='hdb' bus='ide'/>
- </disk>
<interface type='bridge'>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
--
1.7.5.3
13 years
[libvirt] Notes from the KVM Forum relevant to libvirt
by Daniel P. Berrange
I was at the KVM Forum / LinuxCon last week and there were many
interesting things discussed which are relevant to ongoing libvirt
development. Here was the list that caught my attention. If I have
missed any, fill in the gaps....
- Sandbox/container KVM. The Solaris port of KVM puts QEMU inside
a zone so that an exploit of QEMU can't escape into the full OS.
Containers are Linux's parallel of Zones, and while not nearly as
secure yet, it would still be worth using more containers support
to confine QEMU.
- Events for object changes. We already have async events for virDomainPtr.
We need the same for virInterfacePtr, virStoragePoolPtr, virStorageVolPtr
and virNodeDevPtr, so that at the very least applications can be notified
when objects are created or removed. For virNodeDevPtr we also want to
be notified when properties change (ie CDROM media change).
- CGroups passthrough. There is alot of experimentation with cgroups. We
don't want to expose cgroups as a direct concept in the libvirt API,
but we should consider putting a generic cgroups get/set in the
libvirt-qemu.so library, or create a libvirt-linux.so library.
Also likely add a <linux:cgroups> XML element to store arbitrary
tunables in the XML. Same (low) level of support as with qemu:XXX
of course
- CPUSet for changing CPU + Memory NUMA pinning. The CPUset cgroups
controller is able to actually move a guest's memory between NUMA
nodes. We can already change VCPU pinning, but we need a new API
to do node pinning of the whole VM, so we can ensure the I/O threads
are also moved. We also need an API to move the memory pinning to
new nodes.
- Guest NUMA topology. If we have guests with RAM size > node size,
we need to expose a NUMA topology into the guest. The CPU/memory
pinning APIs will also need to be able to pin individual guest
NUMA nodes to individual host NUMA nodes.
- AHCI controller. IDE is going the way of the dodo. We need to add
support for QEMU's new AHCI controller. This is quite simple, we
already have a 'sata' disk type we can wire up to QEMU
- VFIO PCI passthru. The current PCI assignment code may well be
changed to use something called 'VFIO'. This will need some
work in libvirt to support new CLI arg syntax, and probably
some SELinux work
- QCow3. There will soon be a QCow3 format. We need to add code to
detect it and extract backing stores, etc. Trivial since the primary
header format will still be the same as QCow2.
- QMP completion. Given anthony's plan for a complete replacement of
the current CLI + monitor syntax in QEMU 2.0 (long way out), he has
dropped objections to adding new commands to QMP in the near future.
So all existing HMP commands will immediately be made available in
QMP with no attempt to re-design them now. So the need for the HMP
passthrough command will soon go away.
- Migration + VEPA/VNLink failures. As raised previously on this list,
Cisco really wants libvirt to have the ability to do migration, and
optionally *not* fail, even if the VEPA/VNLink setup fails. This will
require an event notification to the app if a failure of a device
backend occurs, and an API to let the admin app fix the device backend
(virDomainUpdateDevice) and some way to tell migration what bits are
allowed to fail.
- Virtio SCSI. We need to support this new stuff in QEMU when it is
eventually implemented. It will mean we avoid the PCI slot usage
problems inherant in virtio-blk, and get other things like multipath
and decent SCSI passthrough support.
- USB 2.0. We need to support this in libvirt asap. It is very important
for desktop experiance and to support better integration with SPICE
This also gets us proper USB port addressing. Fun footnote, QEMU USB
has *never* supported migration. The USB tablet only works by sheer
luck, as OS' see the device disappear on migration & come back with
different device ID/port addr and so does a re-initialize !
- Native KVM tool. The problem statement was that the QEMU code is too
big/complex & and command line args are too complex, so lets rewrite
from scratch to make the code small & CLI simple. They achieve this,
but of course primarily because they lack so many features compared
to QEMU. They had libvirt support as a bullet point on their preso,
but I'm not expecting it to replace the current QEMU KVM support in
the forseeable future, given its current level of features and the
size of its dev team compared to QEMU/KVM. They did have some fun
demos of booting using the host OS filesystem though. We can
actually do the same with regular KVM/libvirt but there's no nice
demo tool to show it off. I'm hoping to create one....
- Shared memory devices. Some people doing high performance work are
using the QEMU shared memory device. We don't support this (ivhshm
device) in libvirt yet. Fairly niche use cases but might be nice to
have this.
- SDK / Docs. Request for a more SDK like approach to KVM development
tools and documentation. Also want to simplify libvirt operations.
The exposure of the virt-install internal API as official GObjects
would have significantly helped the project Ricardo (from IBM)
described in his presentation. Of course no one can argue that we
need more documentation in every area.
- USB managed mode. As we do with PCI passthrough, we should be able
to detach USB device from host OS, and perform a reset before
attaching to the guest, and most importantly track which USB devices
have been given to which guest, so we don't duplicate assign. We have
all neccessary APIs, just need to wire them up.
- PCI passthrough. We need to support setting of MAC addr, VLAN and
VEPA/VNLink properties against VFs from SRIOV NICs that are assigned
to a guest.
For those who were not at the KVM Forum, the presentations are already
available online at:
http://www.linux-kvm.org/page/KVM_Forum_2011
All the session were also video recorded, so sometime in the next week
or two, there should be OGG videos of the talks being uploaded to the
same site.
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 :|
13 years
[libvirt] [PATCH] vbox: Support shared folders
by Matthias Bolte
Shared folders are handled as filesystems and can also be hotplugged.
---
Currently this just maps shared folder to a filesystem element with type
mount. The filesystem element has an accessmode attribute that is not
useful for VirtualBox. Als the target element only has a dir attribute,
but VirtualBox shares doen't support that, you can only give them a name.
<filesystem type='mount' accessmode='passthrough'>
<source dir='/tmp'/>
<target dir='foobar'/>
<readonly/>
</filesystem>
I wonder if we should add a shared folder type like this:
<filesystem type='sharedfolder'>
<source dir='/tmp'/>
<target name='foobar'/>
<readonly/>
</filesystem>
Or is this to specific to VirtualBox?
VirtualBox 4.0 added the automount option that automatically mounts a
shared folder in the guest. On Windows it is mounted to a free drive
letter on Linux it's mounted to /media/<prefix>_<shared-folder-name>.
The <prefix> is a global configuration option in VirtualBox. I wonder
if and how to expose that in libvirt.
Matthias
docs/drvvbox.html.in | 5 ++
src/vbox/vbox_tmpl.c | 140 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 145 insertions(+), 0 deletions(-)
diff --git a/docs/drvvbox.html.in b/docs/drvvbox.html.in
index ef55757..1fcafde 100644
--- a/docs/drvvbox.html.in
+++ b/docs/drvvbox.html.in
@@ -61,6 +61,11 @@ vbox+ssh://user@example.com/session (remote access, SSH tunnelled)
<target dev='fda'/>
</disk>
+ <filesystem type='mount'>
+ <source dir='/home/user/stuff'/>
+ <target dir='my-shared-folder'/>
+ </filesystem>
+
<!--BRIDGE-->
<interface type='bridge'>
<source bridge='eth0'/>
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 2986f5a..13c324f 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -2249,6 +2249,7 @@ static char *vboxDomainGetXMLDesc(virDomainPtr dom, int flags) {
/* Not supported by libvirt yet */
} else if (device == DeviceType_SharedFolder) {
/* Not supported by libvirt yet */
+ /* Can VirtualBox really boot from a shared folder? */
}
}
@@ -2752,6 +2753,67 @@ static char *vboxDomainGetXMLDesc(virDomainPtr dom, int flags) {
#endif /* VBOX_API_VERSION >= 3001 */
+ /* shared folders */
+ vboxArray sharedFolders = VBOX_ARRAY_INITIALIZER;
+
+ def->nfss = 0;
+
+ vboxArrayGet(&sharedFolders, machine,
+ machine->vtbl->GetSharedFolders);
+
+ if (sharedFolders.count > 0) {
+ if (VIR_ALLOC_N(def->fss, sharedFolders.count) < 0) {
+ virReportOOMError();
+ goto sharedFoldersCleanup;
+ }
+
+ for (i = 0; i < sharedFolders.count; i++) {
+ ISharedFolder *sharedFolder = sharedFolders.items[i];
+ PRUnichar *nameUtf16 = NULL;
+ char *name = NULL;
+ PRUnichar *hostPathUtf16 = NULL;
+ char *hostPath = NULL;
+ PRBool writable = PR_FALSE;
+
+ if (VIR_ALLOC(def->fss[i]) < 0) {
+ virReportOOMError();
+ goto sharedFoldersCleanup;
+ }
+
+ def->fss[i]->type = VIR_DOMAIN_FS_TYPE_MOUNT;
+
+ sharedFolder->vtbl->GetHostPath(sharedFolder, &hostPathUtf16);
+ VBOX_UTF16_TO_UTF8(hostPathUtf16, &hostPath);
+ def->fss[i]->src = strdup(hostPath);
+ VBOX_UTF8_FREE(hostPath);
+ VBOX_UTF16_FREE(hostPathUtf16);
+
+ if (def->fss[i]->src == NULL) {
+ virReportOOMError();
+ goto sharedFoldersCleanup;
+ }
+
+ sharedFolder->vtbl->GetName(sharedFolder, &nameUtf16);
+ VBOX_UTF16_TO_UTF8(nameUtf16, &name);
+ def->fss[i]->dst = strdup(name);
+ VBOX_UTF8_FREE(name);
+ VBOX_UTF16_FREE(nameUtf16);
+
+ if (def->fss[i]->dst == NULL) {
+ virReportOOMError();
+ goto sharedFoldersCleanup;
+ }
+
+ sharedFolder->vtbl->GetWritable(sharedFolder, &writable);
+ def->fss[i]->readonly = !writable;
+
+ ++def->nfss;
+ }
+ }
+
+sharedFoldersCleanup:
+ vboxArrayRelease(&sharedFolders);
+
/* dump network cards if present */
def->nnets = 0;
/* Get which network cards are enabled */
@@ -4790,6 +4852,38 @@ vboxAttachUSB(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
}
}
+static void
+vboxAttachSharedFolder(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
+{
+ int i;
+ PRUnichar *nameUtf16;
+ PRUnichar *hostPathUtf16;
+ PRBool writable;
+
+ if (def->nfss == 0)
+ return;
+
+ for (i = 0; i < def->nfss; i++) {
+ if (def->fss[i]->type != VIR_DOMAIN_FS_TYPE_MOUNT)
+ continue;
+
+ VBOX_UTF8_TO_UTF16(def->fss[i]->dst, &nameUtf16);
+ VBOX_UTF8_TO_UTF16(def->fss[i]->src, &hostPathUtf16);
+ writable = !def->fss[i]->readonly;
+
+#if VBOX_API_VERSION < 4000
+ machine->vtbl->CreateSharedFolder(machine, nameUtf16, hostPathUtf16,
+ writable);
+#else /* VBOX_API_VERSION >= 4000 */
+ machine->vtbl->CreateSharedFolder(machine, nameUtf16, hostPathUtf16,
+ writable, PR_FALSE);
+#endif /* VBOX_API_VERSION >= 4000 */
+
+ VBOX_UTF16_FREE(nameUtf16);
+ VBOX_UTF16_FREE(hostPathUtf16);
+ }
+}
+
static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml) {
VBOX_OBJECT_CHECK(conn, virDomainPtr, NULL);
IMachine *machine = NULL;
@@ -4927,6 +5021,7 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml) {
vboxAttachVideo(def, machine);
vboxAttachDisplay(def, data, machine);
vboxAttachUSB(def, data, machine);
+ vboxAttachSharedFolder(def, data, machine);
/* Save the machine settings made till now and close the
* session. also free up the mchiid variable used.
@@ -5271,6 +5366,34 @@ static int vboxDomainAttachDeviceImpl(virDomainPtr dom,
if (dev->data.hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
}
}
+ } else if (dev->type == VIR_DOMAIN_DEVICE_FS &&
+ dev->data.fs->type == VIR_DOMAIN_FS_TYPE_MOUNT) {
+ PRUnichar *nameUtf16;
+ PRUnichar *hostPathUtf16;
+ PRBool writable;
+
+ VBOX_UTF8_TO_UTF16(dev->data.fs->dst, &nameUtf16);
+ VBOX_UTF8_TO_UTF16(dev->data.fs->src, &hostPathUtf16);
+ writable = !dev->data.fs->readonly;
+
+#if VBOX_API_VERSION < 4000
+ rc = machine->vtbl->CreateSharedFolder(machine, nameUtf16, hostPathUtf16,
+ writable);
+#else /* VBOX_API_VERSION >= 4000 */
+ rc = machine->vtbl->CreateSharedFolder(machine, nameUtf16, hostPathUtf16,
+ writable, PR_FALSE);
+#endif /* VBOX_API_VERSION >= 4000 */
+
+ if (NS_FAILED(rc)) {
+ vboxError(VIR_ERR_INTERNAL_ERROR,
+ _("could not attach shared folder '%s', rc=%08x"),
+ dev->data.fs->dst, (unsigned)rc);
+ } else {
+ ret = 0;
+ }
+
+ VBOX_UTF16_FREE(nameUtf16);
+ VBOX_UTF16_FREE(hostPathUtf16);
}
machine->vtbl->SaveSettings(machine);
VBOX_RELEASE(machine);
@@ -5425,6 +5548,23 @@ static int vboxDomainDetachDevice(virDomainPtr dom, const char *xml) {
if (dev->data.hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
}
}
+ } else if (dev->type == VIR_DOMAIN_DEVICE_FS &&
+ dev->data.fs->type == VIR_DOMAIN_FS_TYPE_MOUNT) {
+ PRUnichar *nameUtf16;
+
+ VBOX_UTF8_TO_UTF16(dev->data.fs->dst, &nameUtf16);
+
+ rc = machine->vtbl->RemoveSharedFolder(machine, nameUtf16);
+
+ if (NS_FAILED(rc)) {
+ vboxError(VIR_ERR_INTERNAL_ERROR,
+ _("could not detach shared folder '%s', rc=%08x"),
+ dev->data.fs->dst, (unsigned)rc);
+ } else {
+ ret = 0;
+ }
+
+ VBOX_UTF16_FREE(nameUtf16);
}
machine->vtbl->SaveSettings(machine);
VBOX_RELEASE(machine);
--
1.7.0.4
13 years
[libvirt] [PATCH] xenapi: Improve error reporting in xenapiOpen once again
by Matthias Bolte
privP->session->error_description is a list and in order to get the
complete error message all parts of the list should be concatenated.
xenapiSessionErrorHandler does this when its third parameter is NULL.
The current code discards all but the first part of the error message
resulting in a potentially incomplete error message.
This partly reverts 006be75ee214f9b4, that tried to avoid reporting
a (null) in the error message. The actual problem is more general in
returnErrorFromSession that might return NULL if there is no error.
Make sure that returnErrorFromSession return non-NULL always. Also
don't skip the last error message part.
---
src/xenapi/xenapi_driver.c | 5 +----
src/xenapi/xenapi_utils.c | 4 +++-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index 97da1d1..77bf82d 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -193,10 +193,7 @@ xenapiOpen (virConnectPtr conn, virConnectAuthPtr auth,
return VIR_DRV_OPEN_SUCCESS;
}
- xenapiSessionErrorHandler(conn, VIR_ERR_AUTH_FAILED,
- *privP->session->error_description != NULL ?
- *privP->session->error_description :
- _("unknown error"));
+ xenapiSessionErrorHandler(conn, VIR_ERR_AUTH_FAILED, NULL);
error:
VIR_FREE(username);
diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c
index 342ae5b..79fd946 100644
--- a/src/xenapi/xenapi_utils.c
+++ b/src/xenapi/xenapi_utils.c
@@ -272,12 +272,14 @@ returnErrorFromSession(xen_session *session)
{
int i;
virBuffer buf = VIR_BUFFER_INITIALIZER;
- for (i = 0; i < session->error_description_count - 1; i++) {
+ for (i = 0; i < session->error_description_count; i++) {
if (!i)
virBufferEscapeString(&buf, "%s", session->error_description[i]);
else
virBufferEscapeString(&buf, " : %s", session->error_description[i]);
}
+ if (virBufferUse(&buf) < 1)
+ virBufferAdd(&buf, _("unknown error"), -1);
return virBufferContentAndReset(&buf);
}
--
1.7.4.1
13 years
[libvirt] [PATCHv2 00/13] fix <domainsnapshot> indentation
by Eric Blake
A rather revamped series, based on comments from v1:
https://www.redhat.com/archives/libvir-list/2011-September/msg00916.html
Implementing auto-indent as part of virBuffer indeed makes things
easier - I no longer have to pass around an explicit indent parameter,
since it is instead part of the virBufferPtr already being passed.
If you are trying to compare to the v1 thread, the correlation is:
1 - new to this series
2 - split out from 1/14
3 - new to this series
4 - new to this series
5 - compare to 2/14
6 - compare to 14/14
7 - compare to 4/14
8 - compare to 5/14
9 - compare to 9/14
10 - compare to 11/14
11 - compare to 10/14
12 - folds in changes from 3, 6, 7, 8, 12, 13/14
13 - compare to 1/14, although I'm okay with ditching this one now
With just patches 1-12, there is a net reduction in lines of code in
src/ (the overall series adds lines, but that's thanks to tests/).
Eric Blake (13):
virbuf: fix const-correctness
virbuf: improve testsuite reporting
virbuf: more detailed error reporting
virbuf: add auto-indentation support
snapshot: indent domain xml when nesting
snapshot: test domainsnapshot indentation
snapshot: simplify indentation of sysinfo
snapshot: simplify indentation of cpu features
snapshot: simplify indentation of network xml
snapshot: simplify indentation of nwfilter
snapshot: simplify indentation of disk encryption xml
snapshot: minor cleanups from reviewing indentation
virbuf: add explicit indentation functions
.gitignore | 1 +
src/conf/capabilities.c | 8 +-
src/conf/cpu_conf.c | 42 +--
src/conf/cpu_conf.h | 9 +-
src/conf/domain_conf.c | 268 +++++++-------
src/conf/domain_conf.h | 5 +-
src/conf/network_conf.c | 14 +-
src/conf/nwfilter_conf.c | 18 +-
src/conf/nwfilter_params.c | 45 +--
src/conf/nwfilter_params.h | 7 +-
src/conf/storage_conf.c | 9 +-
src/conf/storage_encryption_conf.c | 20 +-
src/conf/storage_encryption_conf.h | 5 +-
src/cpu/cpu.c | 2 +-
src/libvirt_private.syms | 6 +
src/qemu/qemu_driver.c | 9 +-
src/qemu/qemu_migration.c | 25 +-
src/util/buf.c | 258 +++++++++----
src/util/buf.h | 46 ++-
src/util/network.c | 49 +--
src/util/network.h | 11 +-
src/util/sysinfo.c | 399 +++++++--------------
src/util/sysinfo.h | 3 +-
tests/Makefile.am | 14 +-
tests/cputest.c | 2 +-
tests/domainsnapshotxml2xmlout/all_parameters.xml | 2 +-
tests/domainsnapshotxml2xmlout/disk_snapshot.xml | 102 +++---
tests/domainsnapshotxml2xmlout/full_domain.xml | 52 ++--
tests/domainsnapshotxml2xmltest.c | 128 +++++++
tests/testutils.c | 2 +-
tests/virbuftest.c | 123 ++++++-
31 files changed, 949 insertions(+), 735 deletions(-)
create mode 100644 tests/domainsnapshotxml2xmltest.c
--
1.7.4.4
13 years, 1 month
[libvirt] [PATCH] Allow use of file images for LXC container filesystems
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
A previous commit gave the LXC driver the ability to mount
block devices for the container filesystem. Through use of
the loopback device functionality, we can build on this to
support use of plain file images for LXC filesytems.
By setting the LO_FLAGS_AUTOCLEAR flag we can ensure that
the loop device automatically disappears when the container
dies / shuts down
* src/lxc/lxc_container.c: Raise error if we see a file
based filesystem, since it should have been turned into
a loopback device already
* src/lxc/lxc_controller.c: Rewrite any filesystems of
type=file, into type=block, by binding the file image
to a free loop device
---
src/lxc/lxc_container.c | 5 ++
src/lxc/lxc_controller.c | 176 +++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 179 insertions(+), 2 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index f6ab407..bf772e5 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -797,6 +797,11 @@ static int lxcContainerMountFS(virDomainFSDefPtr fs,
if (lxcContainerMountFSBlock(fs, srcprefix) < 0)
return -1;
break;
+ case VIR_DOMAIN_FS_TYPE_FILE:
+ lxcError(VIR_ERR_INTERNAL_ERROR,
+ _("Unexpected filesystem type %s"),
+ virDomainFSTypeToString(fs->type));
+ break;
default:
lxcError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Cannot mount filesystem type %s"),
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 8848ae2..45b4c70 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -39,6 +39,8 @@
#include <getopt.h>
#include <sys/mount.h>
#include <locale.h>
+#include <linux/loop.h>
+#include <dirent.h>
#if HAVE_CAPNG
# include <cap-ng.h>
@@ -63,6 +65,160 @@ struct cgroup_device_policy {
int minor;
};
+
+static int lxcGetLoopFD(char **devname)
+{
+ int fd = -1;
+ DIR *dh = NULL;
+ struct dirent *de;
+ char *looppath;
+ struct loop_info64 lo;
+
+ VIR_DEBUG("Looking for loop devices in /dev");
+
+ if (!(dh = opendir("/dev"))) {
+ virReportSystemError(errno, "%s",
+ _("Unable to read /dev"));
+ goto cleanup;
+ }
+
+ while ((de = readdir(dh)) != NULL) {
+ if (!STRPREFIX(de->d_name, "loop"))
+ continue;
+
+ if (virAsprintf(&looppath, "/dev/%s", de->d_name) < 0) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ VIR_DEBUG("Checking up on device %s", looppath);
+ if ((fd = open(looppath, O_RDWR)) < 0) {
+ virReportSystemError(errno,
+ _("Unable to open %s"), looppath);
+ goto cleanup;
+ }
+
+ if (ioctl(fd, LOOP_GET_STATUS64, &lo) < 0) {
+ /* Got a free device, return the fd */
+ if (errno == ENXIO)
+ goto cleanup;
+
+ VIR_FORCE_CLOSE(fd);
+ virReportSystemError(errno,
+ _("Unable to get loop status on %s"),
+ looppath);
+ goto cleanup;
+ }
+
+ /* Oh well, try the next device */
+ VIR_FORCE_CLOSE(fd);
+ VIR_FREE(looppath);
+ }
+
+ lxcError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to find a free loop device in /dev"));
+
+cleanup:
+ if (fd != -1) {
+ VIR_DEBUG("Got free loop device %s %d", looppath, fd);
+ *devname = looppath;
+ } else {
+ VIR_DEBUG("No free loop devices available");
+ VIR_FREE(looppath);
+ }
+ if (dh)
+ closedir(dh);
+ return fd;
+}
+
+static int lxcSetupLoopDevice(virDomainFSDefPtr fs)
+{
+ int lofd = -1;
+ int fsfd = -1;
+ struct loop_info64 lo;
+ char *loname = NULL;
+ int ret = -1;
+
+ if ((lofd = lxcGetLoopFD(&loname)) < 0)
+ return -1;
+
+ memset(&lo, 0, sizeof(lo));
+ lo.lo_flags = LO_FLAGS_AUTOCLEAR;
+
+ if ((fsfd = open(fs->src, O_RDWR)) < 0) {
+ virReportSystemError(errno,
+ _("Unable to open %s"), fs->src);
+ goto cleanup;
+ }
+
+ if (ioctl(lofd, LOOP_SET_FD, fsfd) < 0) {
+ virReportSystemError(errno,
+ _("Unable to attach %s to loop device"),
+ fs->src);
+ goto cleanup;
+ }
+
+ if (ioctl(lofd, LOOP_SET_STATUS64, &lo) < 0) {
+ virReportSystemError(errno, "%s",
+ _("Unable to mark loop device as autoclear"));
+
+ if (ioctl(lofd, LOOP_CLR_FD, 0) < 0)
+ VIR_WARN("Unable to detach %s from loop device", fs->src);
+ goto cleanup;
+ }
+
+ VIR_DEBUG("Attached loop device %s %d to %s", fs->src, lofd, loname);
+ /*
+ * We now change it into a block device type, so that
+ * the rest of container setup 'just works'
+ */
+ fs->type = VIR_DOMAIN_FS_TYPE_BLOCK;
+ VIR_FREE(fs->src);
+ fs->src = loname;
+ loname = NULL;
+
+ ret = 0;
+
+cleanup:
+ VIR_FREE(loname);
+ VIR_FORCE_CLOSE(fsfd);
+ if (ret == -1)
+ VIR_FORCE_CLOSE(lofd);
+ return lofd;
+}
+
+
+static int lxcSetupLoopDevices(virDomainDefPtr def, size_t *nloopDevs, int **loopDevs)
+{
+ size_t i;
+ int ret = -1;
+
+ for (i = 0 ; i < def->nfss ; i++) {
+ int fd;
+
+ if (def->fss[i]->type != VIR_DOMAIN_FS_TYPE_FILE)
+ continue;
+
+ fd = lxcSetupLoopDevice(def->fss[i]);
+ if (fd < 0)
+ goto cleanup;
+
+ VIR_DEBUG("Saving loop fd %d", fd);
+ if (VIR_REALLOC_N(*loopDevs, *nloopDevs+1) < 0) {
+ VIR_FORCE_CLOSE(fd);
+ virReportOOMError();
+ goto cleanup;
+ }
+ (*loopDevs)[*nloopDevs++] = fd;
+ }
+
+ VIR_DEBUG("Setup all loop devices");
+ ret = 0;
+
+cleanup:
+ return ret;
+}
+
/**
* lxcSetContainerResources
* @def: pointer to virtual machine structure
@@ -641,6 +797,9 @@ lxcControllerRun(virDomainDefPtr def,
virDomainFSDefPtr root;
char *devpts = NULL;
char *devptmx = NULL;
+ size_t nloopDevs = 0;
+ int *loopDevs = NULL;
+ size_t i;
if (socketpair(PF_UNIX, SOCK_STREAM, 0, control) < 0) {
virReportSystemError(errno, "%s",
@@ -654,6 +813,9 @@ lxcControllerRun(virDomainDefPtr def,
goto cleanup;
}
+ if (lxcSetupLoopDevices(def, &nloopDevs, &loopDevs) < 0)
+ goto cleanup;
+
root = virDomainGetRootFilesystem(def);
if (lxcSetContainerResources(def) < 0)
@@ -778,8 +940,14 @@ lxcControllerRun(virDomainDefPtr def,
goto cleanup;
}
- /* Now the container is running, there's no need for us to keep
- any elevated capabilities */
+ /* Now the container is fully setup... */
+
+ /* ...we can close the loop devices... */
+
+ for (i = 0 ; i < nloopDevs ; i++)
+ VIR_FORCE_CLOSE(loopDevs[i]);
+
+ /* ...and reduce our privileges */
if (lxcControllerClearCapabilities() < 0)
goto cleanup;
@@ -803,6 +971,10 @@ cleanup:
VIR_FORCE_CLOSE(containerhandshake[0]);
VIR_FORCE_CLOSE(containerhandshake[1]);
+ for (i = 0 ; i < nloopDevs ; i++)
+ VIR_FORCE_CLOSE(loopDevs[i]);
+ VIR_FREE(loopDevs);
+
if (container > 1) {
int status;
kill(container, SIGTERM);
--
1.7.6
13 years, 1 month
[libvirt] qemu-namespace handling?
by Philipp Hahn
Hello,
some time ago I hand to manipulate the domain XML description using Pythons
Elemtree XML implementation, which had problems generating the right format
for libvirt: elemtree just supports adding Qname elements (that
is "{http://libvirt.org/schemas/domain/qemu/1.0}commandline") which
internally would create a temporary binding of this namespace to the "ns0"
Prefix.
My work-around for Elemtree was the add the name-space mapping for "qemu"
to "http://libvirt.org/schemas/domain/qemu/1.0" to ETs internal mapping table
and add an "xmlns:qemu" attribute by hand:
ET._namespace_map[QEMU_URI] = 'qemu'
domain.attrib['xmlns:qemu'] = QEMU_URI
libvirt on the other hand expects the prefix to be "qemu" and only checks,
that this prefix is bound to the URI mentioned above at the root node).
The following examples would be XML valid, but are not accepted by libvirt:
<domain>...
<qemu:commandline xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0">
...</qemu:commandline>
</domain>
<domain xmlns:ns0="http://libvirt.org/schemas/domain/qemu/1.0">...
<ns0:commandline>
...</ns0:commandline>
</domain>
The following (esoteric) example might be wrongly accepted by libvirt
(untested):
<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0">
<qemu:commandline xmlns:qemu="urn:foo">
...</qemu:commandline>
</domain>
I don't know if this is worth fixing, but I still encountered the first two
problems myself and had to spend some time to detecting what I did wrong. So
at least I want to share my finding with others, so they don't do the same
mistake.
Sincerely
Philipp Hahn
--
Philipp Hahn Open Source Software Engineer hahn(a)univention.de
Univention GmbH Linux for Your Business fon: +49 421 22 232- 0
Mary-Somerville-Str.1 D-28359 Bremen fax: +49 421 22 232-99
http://www.univention.de/
13 years, 1 month
[libvirt] [PATCH] Add AHCI support to qemu driver
by Jim Fehlig
Tested with multiple AHCI controllers and multiple disks attached
to a controller. E.g.,
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/test/disk0.raw'/>
<target dev='sda' bus='sata'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/test/disk1.raw'/>
<target dev='sdb' bus='sata'/>
<address type='drive' controller='0' bus='0' unit='1'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/test/disk2.raw'/>
<target dev='sdc' bus='sata'/>
<address type='drive' controller='1' bus='0' unit='0'/>
</disk>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</controller>
<controller type='sata' index='1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</controller>
---
docs/formatdomain.html.in | 9 +++--
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 14 +++++++++
src/qemu/qemu_capabilities.c | 3 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 30 ++++++++++++++++----
.../qemuxml2argv-disk-sata-device.args | 6 ++++
.../qemuxml2argv-disk-sata-device.xml | 25 ++++++++++++++++
tests/qemuxml2argvtest.c | 3 ++
9 files changed, 82 insertions(+), 10 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 3087d01..b6a0c66 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -972,11 +972,12 @@
as a device ordering hint. The optional <code>bus</code>
attribute specifies the type of disk device to emulate;
possible values are driver specific, with typical values being
- "ide", "scsi", "virtio", "xen" or "usb". If omitted, the bus type is
- inferred from the style of the device name. eg, a device named 'sda'
- will typically be exported using a SCSI bus.
+ "ide", "scsi", "virtio", "xen", "usb" or "sata". If omitted, the bus
+ type is inferred from the style of the device name. eg, a device named
+ 'sda' will typically be exported using a SCSI bus.
<span class="since">Since 0.0.3; <code>bus</code> attribute since 0.4.3;
- "usb" attribute value since after 0.4.4</span></dd>
+ "usb" attribute value since after 0.4.4; "sata" attribute value since
+ 0.9.7</span></dd>
<dt><code>driver</code></dt>
<dd>
The optional driver element allows specifying further details
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index be98be0..675d55d 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -790,6 +790,7 @@
<value>xen</value>
<value>usb</value>
<value>uml</value>
+ <value>sata</value>
</choice>
</attribute>
</optional>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a918679..6a7f296 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2157,6 +2157,15 @@ virDomainDiskDefAssignAddress(virCapsPtr caps, virDomainDiskDefPtr def)
def->info.addr.drive.unit = (idx % 2);
break;
+ case VIR_DOMAIN_DISK_BUS_SATA:
+ /* For SATA we define the default mapping to be 6 units
+ * per bus, 1 bus per controller, many controllers */
+ def->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE;
+ def->info.addr.drive.controller = idx / 6;
+ def->info.addr.drive.bus = 0;
+ def->info.addr.drive.unit = idx % 6;
+ break;
+
case VIR_DOMAIN_DISK_BUS_FDC:
/* For FDC we define the default mapping to be 2 units
* per bus, 1 bus per controller, many controllers */
@@ -8675,6 +8684,11 @@ int virDomainDefAddImplicitControllers(virDomainDefPtr def)
VIR_DOMAIN_DISK_BUS_IDE) < 0)
return -1;
+ if (virDomainDefAddDiskControllersForType(def,
+ VIR_DOMAIN_CONTROLLER_TYPE_SATA,
+ VIR_DOMAIN_DISK_BUS_SATA) < 0)
+ return -1;
+
if (virDomainDefMaybeAddVirtioSerialController(def) < 0)
return -1;
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 8e20e3f..7122756 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -139,6 +139,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
"no-shutdown",
"cache-unsafe", /* 75 */
+ "ich9-ahci",
);
struct qemu_feature_flags {
@@ -1241,6 +1242,8 @@ qemuCapsParseDeviceStr(const char *str, virBitmapPtr flags)
qemuCapsSet(flags, QEMU_CAPS_USB_REDIR);
if (strstr(str, "name \"usb-hub\""))
qemuCapsSet(flags, QEMU_CAPS_USB_HUB);
+ if (strstr(str, "name \"ich9-ahci\""))
+ qemuCapsSet(flags, QEMU_CAPS_ICH9_AHCI);
/* Prefer -chardev spicevmc (detected earlier) over -device spicevmc */
if (!qemuCapsGet(flags, QEMU_CAPS_CHARDEV_SPICEVMC) &&
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index ae3de90..1e23451 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -113,6 +113,7 @@ enum qemuCapsFlags {
QEMU_CAPS_NO_SHUTDOWN = 74, /* usable -no-shutdown */
QEMU_CAPS_DRIVE_CACHE_UNSAFE = 75, /* Is cache=unsafe supported? */
+ QEMU_CAPS_ICH9_AHCI = 76, /* -device ich9-ahci */
QEMU_CAPS_LAST, /* this must always be the last item */
};
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 9174a5f..6d6e67d 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1702,6 +1702,12 @@ qemuBuildDriveDevStr(virDomainDiskDefPtr disk,
disk->info.addr.drive.bus,
disk->info.addr.drive.unit);
break;
+ case VIR_DOMAIN_DISK_BUS_SATA:
+ virBufferAddLit(&opt, "ide-drive");
+ virBufferAsprintf(&opt, ",bus=ahci%d.%d",
+ disk->info.addr.drive.controller,
+ disk->info.addr.drive.unit);
+ break;
case VIR_DOMAIN_DISK_BUS_VIRTIO:
virBufferAddLit(&opt, "virtio-blk-pci");
qemuBuildIoEventFdStr(&opt, disk->ioeventfd, qemuCaps);
@@ -1902,6 +1908,10 @@ qemuBuildControllerDevStr(virDomainControllerDefPtr def,
virBufferAsprintf(&buf, "usb-ccid,id=ccid%d", def->idx);
break;
+ case VIR_DOMAIN_CONTROLLER_TYPE_SATA:
+ virBufferAsprintf(&buf, "ahci,id=ahci%d", def->idx);
+ break;
+
case VIR_DOMAIN_CONTROLLER_TYPE_USB:
if (qemuBuildUSBControllerDevStr(def, qemuCaps, &buf) == -1)
goto error;
@@ -3683,14 +3693,22 @@ qemuBuildCommandLine(virConnectPtr conn,
cont->type == VIR_DOMAIN_CONTROLLER_TYPE_FDC)
continue;
- /* QEMU doesn't implement a SATA driver */
+ /* Only recent QEMU implements a SATA (AHCI) controller */
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA) {
- qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("SATA is not supported with this QEMU binary"));
- goto error;
- }
+ if (!qemuCapsGet(qemuCaps, QEMU_CAPS_ICH9_AHCI)) {
+ qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("SATA is not supported with this QEMU binary"));
+ goto error;
+ } else {
+ char *devstr;
- if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
+ virCommandAddArg(cmd, "-device");
+ if (!(devstr = qemuBuildControllerDevStr(cont, qemuCaps, NULL)))
+ goto error;
+
+ virCommandAddArg(cmd, devstr);
+ }
+ } else if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
def->controllers[i]->model == -1 &&
!qemuCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) {
if (usblegacy) {
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-sata-device.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-sata-device.args
new file mode 100644
index 0000000..9908da6
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-sata-device.args
@@ -0,0 +1,6 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
+pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults -monitor \
+unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -device ahci,id=ahci0,\
+bus=pci.0,addr=0x3 -drive file=/dev/HostVG/QEMUGuest1,if=none,\
+id=drive-sata0-0-0 -device ide-drive,bus=ahci0.0,drive=drive-sata0-0-0,\
+id=sata0-0-0 -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-sata-device.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-sata-device.xml
new file mode 100644
index 0000000..68a14f2
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-sata-device.xml
@@ -0,0 +1,25 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219136</memory>
+ <currentMemory>219136</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='sda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' unit='0'/>
+ </disk>
+ <controller type='sata' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 9e174b3..f298d37 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -359,6 +359,9 @@ mymain(void)
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("disk-scsi-device-auto", false,
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
+ DO_TEST("disk-sata-device", false,
+ QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE,
+ QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_ICH9_AHCI);
DO_TEST("disk-aio", false,
QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_AIO,
QEMU_CAPS_DRIVE_CACHE_V2, QEMU_CAPS_DRIVE_FORMAT);
--
1.7.5.4
13 years, 1 month
[libvirt] RPM build failure on Redhat6
by Wayne Xia
Hi, I want to build rpm for latest libvit version on Redhat6, but when
I type:
./autogen.sh --system
make rpm -j4
error happens:
sitemap.html.tmp index.html.tmp archdomain.html.tmp downloads.html.tmp
auth.html.tmp internals/locking.html.tmp archnode.html.tmp
hvsupport.html.tmp bugs.html.tmp java.html.tmp locking.html.tmp
logging.html.tmp testapi.html.tmp formatnetwork.html.tmp
bindings.html.tmp uri.html.tmp drvtest.html.tmp contact.html.tmp
formatnwfilter.html.tmp intro.html.tmp drvxen.html.tmp drvesx.html.tmp
drvqemu.html.tmp drvvmware.html.tmp testsuites.html.tmp
devguide.html.tmp firewall.html.tmp architecture.html.tmp todo.html.tmp
formatsnapshot.html.tmp formatstorage.html.tmp deployment.html.tmp
internals.html.tmp api_extension.html.tmp drvuml.html.tmp
virshcmdref.html.tmp csharp.html.tmp python.html.tmp drvremote.html.tmp
archstorage.html.tmp remote.html.tmp drivers.html.tmp formatnode.html.tmp
make[2]: Leaving directory
`/home/xiawenc/WorkDir/Source/libvirt/libvirt/docs'
make[1]: *** [distdir] Error 1
make[1]: Leaving directory `/home/xiawenc/WorkDir/Source/libvirt/libvirt'
make: *** [rpm] Error 2
does anyone knows what is happening?
--
Best Regards
Wayne Xia
mail:xiawenc@linux.vnet.ibm.com
tel:86-010-82450803
13 years, 1 month
[libvirt] [PATCH v4 0/2] Allow domain reboot after core dump
by Michal Privoznik
This is the 4th (and hopefully last) version of these patches.
diff to v3:
-split in 2 patches
-and some other Eric's suggestions taken in
Michal Privoznik (2):
virDomainCoreDump: Introduce VIR_DUMP_RESET flag
qemu: Implement VIR_DUMP_RESET
include/libvirt/libvirt.h.in | 1 +
src/libvirt.c | 15 ++++++++++++++-
src/qemu/qemu_driver.c | 9 ++++++++-
tools/virsh.c | 3 +++
tools/virsh.pod | 4 +++-
5 files changed, 29 insertions(+), 3 deletions(-)
--
1.7.3.4
13 years, 1 month