[libvirt] [PATCH 0/2] Storage : Fixes for cloning raw volumes
by Prerna Saxena
From: Prerna Saxena <prerna(a)linux.vnet.ibm.com>
Date: Mon, 4 May 2015 12:00:46 -0700
This series has some long-overdue fixes for copying of raw
storage volumes with libvirt.
Prerna Saxena (2):
Storage : Suppress metadata refresh for volumes being built.
Storage : Fix cloning of raw, sparse volumes.
src/storage/storage_backend.c | 5 ++++-
src/storage/storage_driver.c | 5 -----
2 files changed, 4 insertions(+), 6 deletions(-)
--
1.8.3.1
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
9 years, 7 months
[libvirt] [PATCH] lxc: don't up the veth interfaces unless explicitly asked to
by Lubomir Rintel
Upping an interface for no reason and not configuring it is a cardinal sin.
With the default addrgenmode if eui64 it sticks a link-local address to the
interface. That is not good, as NetworkManager would see an address configured,
assume the interface is already configured and won't touch it iself and the
interface might stay unconfigured until the end of the days.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1124721
---
src/lxc/lxc_container.c | 2 +-
src/lxc/lxc_native.c | 10 ++++------
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index cc20b6d..50e38e9 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -541,7 +541,7 @@ static int lxcContainerRenameAndEnableInterfaces(virDomainDefPtr vmDef,
VIR_FREE(ipStr);
}
- if (netDef->linkstate != VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) {
+ if (netDef->linkstate == VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP) {
VIR_DEBUG("Enabling %s", newname);
rc = virNetDevSetOnline(newname, true);
if (rc < 0)
diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c
index c15eb19..2297dbe 100644
--- a/src/lxc/lxc_native.c
+++ b/src/lxc/lxc_native.c
@@ -348,12 +348,10 @@ lxcCreateNetDef(const char *type,
if (VIR_ALLOC(net) < 0)
goto error;
- if (flag) {
- if (STREQ(flag, "up"))
- net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP;
- else
- net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN;
- }
+ if (flag && STREQ(flag, "up"))
+ net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP;
+ else
+ net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN;
if (VIR_STRDUP(net->ifname_guest, name) < 0)
goto error;
--
2.1.0
9 years, 7 months
[libvirt] [PATCH] qemu: multiqueue for ccw devices
by Boris Fiuczynski
Allow ccw devices to be used with multiqueues.
Signed-off-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato(a)linux.vnet.ibm.com>
Reviewed-by: Daniel Hansel <daniel.hansel(a)linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck(a)de.ibm.comCornelia Huck <cornelia.huck(a)de.ibm.com>>
---
src/qemu/qemu_command.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 2137985..0205831 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5062,9 +5062,13 @@ qemuBuildNicDevStr(virDomainDefPtr def,
}
}
if (usingVirtio && vhostfdSize > 1) {
- /* As advised at http://www.linux-kvm.org/page/Multiqueue
- * we should add vectors=2*N+2 where N is the vhostfdSize */
- virBufferAsprintf(&buf, ",mq=on,vectors=%zu", 2 * vhostfdSize + 2);
+ if (net->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
+ virBufferAsprintf(&buf, ",mq=on");
+ } else {
+ /* As advised at http://www.linux-kvm.org/page/Multiqueue
+ * we should add vectors=2*N+2 where N is the vhostfdSize */
+ virBufferAsprintf(&buf, ",mq=on,vectors=%zu", 2 * vhostfdSize + 2);
+ }
}
if (vlan == -1)
virBufferAsprintf(&buf, ",netdev=host%s", net->info.alias);
--
2.3.0
9 years, 7 months
[libvirt] [PATCH] qemuDomainShutdownFlags: check for domain activeness prior to guest presence
by Michal Privoznik
Running shutdown with mode agent on a shutoff domain gives cryptic
error message:
virsh # shutdown --mode agent gentoo
error: Failed to shutdown domain gentoo
error: Guest agent is not responding: QEMU guest agent is not connected
After this patch, the error is more clear:
virsh # shutdown --mode agent gentoo
error: Failed to shutdown domain gentoo
error: Requested operation is not valid: domain is not running
Reported-by: Martin Kletzander <mkletzan(a)redhat.com>
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_driver.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d173aa1..537797e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1989,21 +1989,21 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
+ if (!virDomainObjIsActive(vm)) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
+ goto endjob;
+ }
+
agentForced = agentRequested && !acpiRequested;
if (!qemuDomainAgentAvailable(vm, agentForced)) {
if (agentForced)
goto endjob;
useAgent = false;
}
- if (!virDomainObjIsActive(vm)) {
- virReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("domain is not running"));
- goto endjob;
- }
-
qemuDomainSetFakeReboot(driver, vm, isReboot);
if (useAgent) {
qemuDomainObjEnterAgent(vm);
--
2.3.6
9 years, 7 months
[libvirt] [PATCH] virsh: fix no error output when parse cpulist fail
by Luyao Huang
When we pass a invalid cpulist or the lastcpu in the
cpulist exceed the maxcpu, we cannot get any error.
like this:
# virsh vcpupin test3 1 aaa
# virsh vcpupin test3 1 1000
Because virBitmapParse() use virReportError() to set
the error message, virsh client use vshError to output error.
If we want get the error which set by virReportError(), we need
virGetLastError/virGetLastErrorMessage to help us.
However instead of do this, i chose use vshError to output
error when parse failed.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
tools/virsh-domain.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 14e1e35..64bfbfd 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -6362,9 +6362,7 @@ vshParseCPUList(int *cpumaplen, const char *cpulist, int maxcpu)
return NULL;
}
- if (virBitmapToData(map, &cpumap, cpumaplen) < 0)
- goto cleanup;
-
+ virBitmapToData(map, &cpumap, cpumaplen);
cleanup:
virBitmapFree(map);
return cpumap;
@@ -6458,8 +6456,10 @@ cmdVcpuPin(vshControl *ctl, const vshCmd *cmd)
}
} else {
/* Pin mode: pinning specified vcpu to specified physical cpus*/
- if (!(cpumap = vshParseCPUList(&cpumaplen, cpulist, maxcpu)))
+ if (!(cpumap = vshParseCPUList(&cpumaplen, cpulist, maxcpu))) {
+ vshError(ctl, _("vcpupin: invalid cpulist '%s'"), cpulist);
goto cleanup;
+ }
if (flags == -1) {
if (virDomainPinVcpu(dom, vcpu, cpumap, cpumaplen) != 0)
@@ -6577,8 +6577,10 @@ cmdEmulatorPin(vshControl *ctl, const vshCmd *cmd)
}
/* Pin mode: pinning emulator threads to specified physical cpus*/
- if (!(cpumap = vshParseCPUList(&cpumaplen, cpulist, maxcpu)))
+ if (!(cpumap = vshParseCPUList(&cpumaplen, cpulist, maxcpu))) {
+ vshError(ctl, _("emulatorpin: invalid cpulist '%s'"), cpulist);
goto cleanup;
+ }
if (flags == -1)
flags = VIR_DOMAIN_AFFECT_LIVE;
@@ -6854,16 +6856,14 @@ cmdIOThreadPin(vshControl *ctl, const vshCmd *cmd)
goto cleanup;
}
- if (vshCommandOptString(cmd, "cpulist", &cpulist) < 0) {
- vshError(ctl, "%s", _("iothreadpin: invalid cpulist."));
- goto cleanup;
- }
-
if ((maxcpu = vshNodeGetCPUCount(ctl->conn)) < 0)
goto cleanup;
- if (!(cpumap = vshParseCPUList(&cpumaplen, cpulist, maxcpu)))
+ if ((vshCommandOptString(cmd, "cpulist", &cpulist) < 0) ||
+ !(cpumap = vshParseCPUList(&cpumaplen, cpulist, maxcpu))) {
+ vshError(ctl, "%s", _("iothreadpin: invalid cpulist."));
goto cleanup;
+ }
if (virDomainPinIOThread(dom, iothread_id,
cpumap, cpumaplen, flags) != 0)
--
1.8.3.1
9 years, 7 months
[libvirt] [PATCH] libxl: initialize vfb defbools in libxlMakeVfb
by Olaf Hering
If the domU configu has sdl enabled libvirtd crashes:
libvirtd[5158]: libvirtd: libxl.c:343: libxl_defbool_val: Assertion `!libxl_defbool_is_default(db)' failed.
Initialize the relevant defbool variables in libxl_device_vfb.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
Cc: Jim Fehlig <jfehlig(a)suse.com>
---
Seen in 1.2.14.
src/libxl/libxl_conf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 9b3c949..6feb7d9 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1232,6 +1232,7 @@ libxlMakeVfb(virPortAllocatorPtr graphicsports,
switch (l_vfb->type) {
case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
libxl_defbool_set(&x_vfb->sdl.enable, 1);
+ libxl_defbool_set(&x_vfb->vnc.enable, 0);
if (VIR_STRDUP(x_vfb->sdl.display, l_vfb->data.sdl.display) < 0)
return -1;
if (VIR_STRDUP(x_vfb->sdl.xauthority, l_vfb->data.sdl.xauth) < 0)
@@ -1239,6 +1240,7 @@ libxlMakeVfb(virPortAllocatorPtr graphicsports,
break;
case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
libxl_defbool_set(&x_vfb->vnc.enable, 1);
+ libxl_defbool_set(&x_vfb->sdl.enable, 0);
/* driver handles selection of free port */
libxl_defbool_set(&x_vfb->vnc.findunused, 0);
if (l_vfb->data.vnc.autoport) {
9 years, 7 months
Re: [libvirt] [Qemu-devel] [Qemu-block] [RFC] Differential Backups
by Stefan Hajnoczi
On Tue, May 05, 2015 at 11:55:49AM -0400, John Snow wrote:
> On 05/05/2015 06:25 AM, Stefan Hajnoczi wrote:
> >On Wed, Apr 29, 2015 at 06:51:08PM -0400, John Snow wrote:
> >>This is a feature that should be very easy to add on top of the existing
> >>incremental feature, since it's just a difference in how the bitmap is
> >>treated:
> >>
> >>Incremental
> >>- Links to the last incremental (managed by libvirt)
> >>- Clears the bitmap after creation
> >>
> >>Differential:
> >>- Links to the last full backup always (managed by libvirt)
> >>- Does not clear the bitmap after creation
> >>
> >>No biggie.
> >
> >Differential backups can be done using incremental backup functionality
> >in QEMU:
> >
> >The client application points QEMU to the same target repeatedly instead
> >of keeping separate incremental backups.
> >
> >Stefan
> >
>
> Oh, so you're saying:
>
> [anchor]<--[diff1]
>
> And then when making a new incremental, we re-use diff1 as a target and
> overwrite it so that it becomes:
>
> [anchor]<--[diff2]
>
> In effect giving us a differential.
>
> OK, so it's possible, but we still lose out on some flexibility that a
> slightly different mode would provide us, like the ability to keep multiple
> differentials if desired. (Well, I suppose we *can* create those by manually
> copying differentials after we create them, but that seems hackier than
> necessary.)
>
> Still, it would be such a paltry few lines of code and introduce no real
> complexity to the subsystem, and it might make libvirt's time a little
> easier for managing such things.
I have CCed Eric Blake and the libvirt mailing list.
This is a good time to discuss libvirt requirements for backup APIs.
Current work for QEMU 2.4:
* QMP command to take incremental backup of guest disks in a single
atomic operation
* Dirty bitmap persistence across live migration and QEMU restart
Eric: Do you have any opinion on a differential backup feature in
addition to incremental backup.
My thoughts are that QEMU should only copy out changed blocks and let
the backup application worry about concepts like incremental vs
differential.
From a host performance perspective, copying out the same blocks that
have already been sent in a previous backup is a waste of I/O bandwidth.
Even backup applications that want differential backup may not actually
use the QEMU feature for this reason.
Regarding the size of the patch, there's a cost to adding the tests,
documentation, and commiting to QMP APIs. These costs dwarf the small
code change that preserves the dirty bitmap.
If there's a concrete requirement for this feature then I'm happy with
it, but let's not add bells and whistles just because we can.
Stefan
9 years, 7 months
[libvirt] [PATCH] test: remove s390 tests used only for testing usb and ide controllers
by Laine Stump
Back in 2013, commit 877bc089 added in some tests that made sure no
error was generated on a domain definition that had an automatically
added usb controller if that domain didn't have a PCI bus to attach
the usb controller to. In particular, two s390-specific tests were
added, one with <controller type='usb' model='none'/> and another
(called "s390-piix-controllers") that had both usb and ide
controllers, but nothing attached to them.
Then in February of this year, commit 09ab9dcc eliminated the annoying
auto-adding of a usb device for s390 and s390x machines, stating:
"Since s390 does not support usb the default creation of a usb
controller for a domain should not occur."
Since s390 doesn't support usb and usb controllers aren't added to
s390 domain definitions automatically, there is no reason to have the
tests with a usb controller and expect them to succeed. And since the
only reference of an IDE controller wrt s390 that I've found is in the
one test case mentioned above, and the commit log that added it
specifically mentions the purpose to be quieting error messages on
machines with no PCI bus, I'm assuming that the s390 also doesn't
support IDE controllers. Based on that reasoning (and the fact that
s390-piix-controllers causes a test error for an upcoming patch), this
patch removes those two tests.
---
.../qemuxml2argv-s390-piix-controllers.args | 12 --------
.../qemuxml2argv-s390-piix-controllers.xml | 34 ----------------------
.../qemuxml2argv-s390-usb-none.args | 12 --------
.../qemuxml2argv-s390-usb-none.xml | 29 ------------------
tests/qemuxml2argvtest.c | 10 -------
5 files changed, 97 deletions(-)
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-piix-controllers.args
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-piix-controllers.xml
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-usb-none.args
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-usb-none.xml
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-piix-controllers.args b/tests/qemuxml2argvdata/qemuxml2argv-s390-piix-controllers.args
deleted file mode 100644
index e939be4..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-s390-piix-controllers.args
+++ /dev/null
@@ -1,12 +0,0 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-s390x -S -M s390-virtio -m 214 -smp 1 -nographic \
--nodefconfig -nodefaults \
--chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
--mon chardev=charmonitor,id=monitor,mode=readline -no-acpi \
--device virtio-serial-s390,id=virtio-serial0 -drive \
-file=/dev/HostVG/QEMUGuest1,if=none,id=drive-virtio-disk0 \
--device virtio-blk-s390,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
--chardev pty,id=charconsole0 \
--device virtconsole,chardev=charconsole0,id=console0 \
--object rng-random,id=objrng0,filename=/dev/hwrng \
--device virtio-rng-s390,rng=objrng0,id=rng0
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-piix-controllers.xml b/tests/qemuxml2argvdata/qemuxml2argv-s390-piix-controllers.xml
deleted file mode 100644
index a8b72d7..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-s390-piix-controllers.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<domain type='qemu'>
- <name>test</name>
- <memory>219100</memory>
- <currentMemory>219100</currentMemory>
- <os>
- <type arch='s390x' machine='s390-virtio'>hvm</type>
- </os>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
- <devices>
- <emulator>/usr/bin/qemu-system-s390x</emulator>
- <disk type='block' device='disk'>
- <source dev='/dev/HostVG/QEMUGuest1'/>
- <target dev='hda' bus='virtio'/>
- <boot order='1'/>
- </disk>
- <console type='pty'>
- <target type='virtio'/>
- </console>
- <controller type='usb' index='0'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
- </controller>
- <controller type='ide' index='0'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
- </controller>
- <memballoon model='virtio'>
- </memballoon>
- <rng model='virtio'>
- <backend model='random'>/dev/hwrng</backend>
- </rng>
- </devices>
-</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-usb-none.args b/tests/qemuxml2argvdata/qemuxml2argv-s390-usb-none.args
deleted file mode 100644
index 51fcfa6..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-s390-usb-none.args
+++ /dev/null
@@ -1,12 +0,0 @@
-LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-s390x -S -M s390-virtio -m 214 -smp 1 \
--nographic -nodefconfig -nodefaults \
--chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
--mon chardev=charmonitor,id=monitor,mode=readline -no-acpi \
--device virtio-serial-s390,id=virtio-serial0 \
--drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-virtio-disk0 \
--device virtio-blk-s390,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
--chardev pty,id=charconsole0 \
--device virtconsole,chardev=charconsole0,id=console0 \
--object rng-random,id=objrng0,filename=/dev/hwrng \
--device virtio-rng-s390,rng=objrng0,id=rng0
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-usb-none.xml b/tests/qemuxml2argvdata/qemuxml2argv-s390-usb-none.xml
deleted file mode 100644
index f2977b5..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-s390-usb-none.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<domain type='qemu'>
- <name>test</name>
- <memory>219100</memory>
- <currentMemory>219100</currentMemory>
- <os>
- <type arch='s390x' machine='s390-virtio'>hvm</type>
- </os>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
- <devices>
- <emulator>/usr/bin/qemu-system-s390x</emulator>
- <disk type='block' device='disk'>
- <source dev='/dev/HostVG/QEMUGuest1'/>
- <target dev='hda' bus='virtio'/>
- <boot order='1'/>
- </disk>
- <console type='pty'>
- <target type='virtio'/>
- </console>
- <controller type='usb' index='0' model='none'/>
- <memballoon model='virtio'>
- </memballoon>
- <rng model='virtio'>
- <backend model='random'>/dev/hwrng</backend>
- </rng>
- </devices>
-</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 0763068..da5afd4 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1405,16 +1405,6 @@ mymain(void)
QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_DEVICE_VIRTIO_RNG,
QEMU_CAPS_OBJECT_RNG_RANDOM);
- DO_TEST("s390-usb-none",
- QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_DRIVE, QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_S390,
- QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM);
-
- DO_TEST("s390-piix-controllers",
- QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_DRIVE, QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_S390,
- QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM);
-
DO_TEST("ppc-dtb", QEMU_CAPS_KVM, QEMU_CAPS_DTB);
DO_TEST("ppce500-serial", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV);
--
2.1.0
9 years, 7 months
[libvirt] [PATCH] libxl: support soundhw for hvm domains
by Jim Fehlig
The xend driver and the parsing/formating code in src/xenconfig
have long supported soundhw. Add support in the libxl driver too.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
This patch continues the tradition of silently ignoring unsupported
config in the libxl driver. But it is an improvement; post-patch
only sound devices after the first are ignored :-).
src/libxl/libxl_conf.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 2a09190..fccada5 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -678,6 +678,19 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
libxl_defbool_set(&b_info->u.hvm.hpet, 1);
}
}
+
+ if (def->nsounds > 0) {
+ /*
+ * Use first sound device. man xl.cfg(5) describes soundhw as
+ * a single device. From the man page: soundhw=DEVICE
+ */
+ virDomainSoundDefPtr snd = def->sounds[0];
+
+ if (VIR_STRDUP(b_info->u.hvm.soundhw,
+ virDomainSoundModelTypeToString(snd->model)) < 0)
+ return -1;
+ }
+
for (i = 0; i < def->os.nBootDevs; i++) {
switch (def->os.bootDevs[i]) {
case VIR_DOMAIN_BOOT_FLOPPY:
--
1.8.4.5
9 years, 7 months
[libvirt] [PATCH] libxl: add logrotate config file
by Jim Fehlig
Add logrotate config for log files in /var/log/libvirt/libxl.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
daemon/Makefile.am | 13 ++++++++++++-
daemon/libvirtd.libxl.logrotate.in | 9 +++++++++
libvirt.spec.in | 3 +++
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 300b9a5..b19a126 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -62,6 +62,7 @@ EXTRA_DIST = \
libvirtd.logrotate.in \
libvirtd.qemu.logrotate.in \
libvirtd.lxc.logrotate.in \
+ libvirtd.libxl.logrotate.in \
libvirtd.uml.logrotate.in \
test_libvirtd.aug.in \
THREADS.txt \
@@ -275,7 +276,8 @@ remote.c: $(DAEMON_GENERATED)
remote.h: $(DAEMON_GENERATED)
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
- libvirtd.uml.logrotate libvirtd.logrotate
+ libvirtd.libxl.logrotate libvirtd.uml.logrotate \
+ libvirtd.logrotate
BUILT_SOURCES += $(LOGROTATE_CONFS)
@@ -297,6 +299,12 @@ libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in
< $< > $@-t && \
mv $@-t $@
+libvirtd.libxl.logrotate: libvirtd.libxl.logrotate.in
+ $(AM_V_GEN)sed \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+ < $< > $@-t && \
+ mv $@-t $@
+
libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
@@ -314,6 +322,8 @@ install-logrotate: $(LOGROTATE_CONFS)
$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.qemu
$(INSTALL_DATA) libvirtd.lxc.logrotate \
$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.lxc
+ $(INSTALL_DATA) libvirtd.libxl.logrotate \
+ $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.libxl
$(INSTALL_DATA) libvirtd.uml.logrotate \
$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.uml
@@ -321,6 +331,7 @@ uninstall-logrotate:
rm -f $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd \
$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.qemu \
$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.lxc \
+ $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.libxl \
$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.uml
rmdir $(DESTDIR)$(localstatedir)/log/libvirt/qemu || :
rmdir $(DESTDIR)$(localstatedir)/log/libvirt/lxc || :
diff --git a/daemon/libvirtd.libxl.logrotate.in b/daemon/libvirtd.libxl.logrotate.in
new file mode 100644
index 0000000..523b2f8
--- /dev/null
+++ b/daemon/libvirtd.libxl.logrotate.in
@@ -0,0 +1,9 @@
+@localstatedir(a)/log/libvirt/libxl/*.log {
+ weekly
+ missingok
+ rotate 4
+ compress
+ delaycompress
+ copytruncate
+ minsize 100k
+}
diff --git a/libvirt.spec.in b/libvirt.spec.in
index f95e31f..3feda9d 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1601,6 +1601,7 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
%endif
%if ! %{with_libxl}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/libxl.conf
+rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.libxl
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_libxl.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
%endif
@@ -2007,6 +2008,7 @@ exit 0
%endif
%if %{with_libxl}
%config(noreplace) %{_sysconfdir}/libvirt/libxl.conf
+%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.libxl
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/
%ghost %dir %{_localstatedir}/run/libvirt/libxl/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/
@@ -2129,6 +2131,7 @@ exit 0
%files daemon-driver-libxl
%defattr(-, root, root)
%config(noreplace) %{_sysconfdir}/libvirt/libxl.conf
+%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.libxl
%config(noreplace) %{_sysconfdir}/libvirt/libxl-lockd.conf
%config(noreplace) %{_sysconfdir}/libvirt/libxl-sanlock.conf
%{_datadir}/augeas/lenses/libvirtd_libxl.aug
--
1.8.4.5
9 years, 7 months