[libvirt] [PATCH] qemuxml2argvtest: Fix test after change of qxl vgamem_mb default
by Michal Privoznik
Well, apparently it's possible for a patch to sneak in through
review process and break 'make check'. It happened just lately
with 0e502466acb84a which changed the default of vgamem_mb for
qxl device. However, there were left some domain XMLs within our
test suite relying on the old default. These should be updated to
match the change.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under build breaker and trivial rules.
tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args
index 5398ffe..92e343f 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args
@@ -2,5 +2,5 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \
-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \
-hda /var/lib/libvirt/images/QEMUGuest1 \
--device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8\
+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16\
,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args
index 82aa0a9..51fc524 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args
@@ -2,7 +2,7 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \
-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \
-hda /var/lib/libvirt/images/QEMUGuest1 \
--device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8\
+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16\
,bus=pci.0,addr=0x2 -device qxl,id=video1,ram_size=67108864,vram_size=67108864\
-,vgamem_mb=8,bus=pci.0,addr=0x4 \
+,vgamem_mb=16,bus=pci.0,addr=0x4 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
--
2.0.5
9 years, 11 months
Re: [libvirt] Error starting domain: internal error: missing IFLA_VF_INFO in netlink response
by Hong-Hua.Yin@freescale.com
Hi Laine,
Sorry to disturb you.
It seemed this issue had been fixed in libvirt-1.2.2/libnl-3.2.22/linux-3.12. But we still got the error on PowerPC platform.
I'll appreciate if you could give any suggestion. We are not sure if any netlink implementation in kernel space is missed.
The scenario is a little complicated. We installed internal PF and VF kernel modules and want to use
<interface type="hostdev" managed="yes"> syntax to start a guest domain with MAC address.
# insmod fslinic.ko max_vfs=2
Freescale 10 Gigabit PCI Express Network Driver
fslinic 0000:01:00.0: Multiqueue Enabled: Rx Queue count = 1, Tx Queue count = 1
fslinic 0000:01:00.0: Freescale (R) 10 Gigabit Network Connection
fslinic 0000:01:00.1: Multiqueue Enabled: Rx Queue count = 1, Tx Queue count = 1
fslinic 0000:01:00.1: Freescale (R) 10 Gigabit Network Connection
# insmod fslinicvf.ko
Freescale 10 Gigabit PCI Express Network Driver
# lspci -mk
00:00.0 "PCI bridge" "Freescale Semiconductor Inc" "Device 0440" -r20 "" ""
01:00.0 "Power PC" "Freescale Semiconductor Inc" "Device 0440" -r20 "" ""
01:00.1 "Power PC" "Freescale Semiconductor Inc" "Device 0440" -r20 "" ""
01:00.4 "Power PC" "Freescale Semiconductor Inc" "Device 0000" -r20 "" ""
01:00.5 "Power PC" "Freescale Semiconductor Inc" "Device 1957" -r20 "" ""
01:01.0 "Power PC" "Freescale Semiconductor Inc" "Device 0000" -r20 "" ""
01:01.1 "Power PC" "Freescale Semiconductor Inc" "Device 1957" -r20 "" ""
0001:00:00.0 "PCI bridge" "Freescale Semiconductor Inc" "Device 0440" -r20 "" ""
0002:00:00.0 "PCI bridge" "Freescale Semiconductor Inc" "Device 0440" -r20 "" ""
# echo 1957 0000 > /sys/bus/pci/drivers/vfio-pci/new_id
# echo 1957 1957 > /sys/bus/pci/drivers/vfio-pci/new_id
# cat interface.xml
<domain type='kvm'>
<name>interface</name>
<memory unit='KiB'>524288</memory>
<currentMemory unit='KiB'>524288</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='ppc64' machine='ppce500'>hvm</type>
<kernel>/dev/shm/uImage</kernel>
<initrd>/dev/shm/ramdisk</initrd>
<cmdline>root=/dev/ram rw console=ttyS0,115200</cmdline>
</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-ppc64</emulator>
<controller type='usb' index='0'/>
<controller type='pci' index='0' model='pci-root'/>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<interface type="hostdev" managed="yes">
<mac address="00:e0:0c:00:20:01"/>
<source>
<address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x04"/>
</source>
</interface>
<memballoon model='virtio'/>
</devices>
</domain>
root@t4240rdb:/var/volatile# virsh start interface
error: Failed to start domain interface
error: internal error: missing IFLA_VF_INFO in netlink response
The debug message is as below:
error : virNetClientProgramDispatchError:175 : internal error: missing IFLA_VF_INFO in netlink response
Do you have any suggestion to investigate/debug this error?
Wish you could reply. Thank you in advance.
Best Regards,
Olivia
> -----Original Message-----
> From: Yin Olivia-R63875
> Sent: Monday, November 24, 2014 7:37 PM
> To: 'libvirt-users(a)redhat.com'; libvir-list(a)redhat.com
> Subject: Error starting domain: internal error: missing IFLA_VF_INFO in netlink
> response
>
> Hi,
>
> We try PCI Passthrough of host network devices on PPC platform.
> http://wiki.libvirt.org/page/Networking#Assignment_with_.3Cinterface_type.3D
> .27hostdev.27.3E_.28SRIOV_devices_only.29
>
> But we got a similar issue as below that reported on RedHat before:
> https://bugzilla.redhat.com/show_bug.cgi?id=1040626
>
> With <hostdev>, it could start VM successfully.
> <hostdev mode='subsystem' type='pci' managed='yes'>
> <driver name='vfio'/>
> <source>
> <address domain='0x0000' bus='0x01' slot='0x00' function='0x4'/>
> </source>
> </hostdev>
>
> Logged into VM and checked for VF using lspci root@model : qemu ppce500:~#
> lspci
> 00:00.0 PCI bridge: Freescale Semiconductor Inc MPC8533E
> 00:02.0 Power PC: Freescale Semiconductor Inc Device 0000 (rev 20)
> 00:03.0 Unclassified device [00ff]: Red Hat, Inc Virtio memory balloon
>
> But it will fail if using <interface type="hostdev">:
> <interface type="hostdev" managed="yes">
> <mac address="00:e0:0c:00:20:01"/>
> <source>
> <address type="pci" domain="0x0000" bus="0x01" slot="0x00"
> function="0x4"/>
> </source>
> </interface>
>
>
> # virsh create vf.xml
> 2014-11-24 11:08:31.390+0000: 3556: info : libvirt version: 1.2.2
> 2014-11-24 11:08:31.390+0000: 3556: debug : virLogParseOutputs:1378 :
> outputs=1:file:virsh.log
> error: Failed to create domain from vf.xml
> error: internal error: missing IFLA_VF_INFO in netlink response
>
> Exactly We're using max_vfs=2 and libnl-3.2.22 # ls -l /usr/lib64/libnl-3.so.200.17.0
> -rwxr-xr-x 1 root root 154440 Sep 17 07:15 /usr/lib64/libnl-3.so.200.17.0
>
>
> Why this issue happened on PPC? Is there anything architecture-specific support
> needed to add?
>
> Thanks,
> Olivia
9 years, 11 months
[libvirt] [PATCH 0/6] Resolve some Coverity errors and other issues found
by John Ferlan
With the build fix, my coverity build worked again (good), but found
more issues (boo).
Consider these changes partially as a replacement for Pavel's patch:
http://www.redhat.com/archives/libvir-list/2015-January/msg00240.html
with some additional changes for checks that need to be made in failure
path scenario. I didn't make any of the code formatting changes Pavel
had made for virDomainNetIpsFormat, but I can do that. I just wanted to
get these on the list for a comparison. Additionally, Pavel's change for
virDomainNetRoutesFormat didn't take into account that the alloc's are
done in a for loop, so both the VIR_FREE's needed to be done in the loop.
There are still some Coverity issues left over after this, but I'm not
quite sure how to fix them, hence the reply on the Xen-xl parser:
http://www.redhat.com/archives/libvir-list/2015-January/msg00243.html
John Ferlan (6):
openvz: Resolve Coverity RESOURCE_LEAK
openvz: Check errors from virSocketAddrFormat
domain_conf: Resolve Coverity RESOURCE_LEAK
domain_conf: Check errors from virSocketAddrFormat
xenconfig: Resolve Coverity RESOURCE_LEAK
virconf: Resolve a possible memory leak in virConfSetValue
src/conf/domain_conf.c | 32 ++++++++++++++++++++++++--------
src/openvz/openvz_driver.c | 3 +++
src/util/virconf.c | 4 +++-
src/xenconfig/xen_xl.c | 6 +++---
4 files changed, 33 insertions(+), 12 deletions(-)
--
2.1.0
9 years, 11 months
[libvirt] [PATCH] cpu: Bugfix for s390 CPU driver to return a host CPU model
by Daniel Hansel
The curent libvirt CPU driver for s390 does not return a host CPU model.
This patch returns 'host' according to the other platforms that would
not decode any CPU model.
This is an intermediate bugfix due to a discussion on OpenStack mailing
list. The final patch introducing the CPU model support for s390x will
exchange the hard-coded decode method.
Signed-off-by: Daniel Hansel <daniel.hansel(a)linux.vnet.ibm.com>
---
src/cpu/cpu_s390.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/cpu/cpu_s390.c b/src/cpu/cpu_s390.c
index f9d7e21..23a7f9d 100644
--- a/src/cpu/cpu_s390.c
+++ b/src/cpu/cpu_s390.c
@@ -25,6 +25,7 @@
#include <config.h>
#include "viralloc.h"
+#include "virstring.h"
#include "cpu.h"
@@ -47,7 +48,7 @@ s390NodeData(virArch arch)
static int
-s390Decode(virCPUDefPtr cpu ATTRIBUTE_UNUSED,
+s390Decode(virCPUDefPtr cpu,
const virCPUData *data ATTRIBUTE_UNUSED,
const char **models ATTRIBUTE_UNUSED,
unsigned int nmodels ATTRIBUTE_UNUSED,
@@ -57,6 +58,10 @@ s390Decode(virCPUDefPtr cpu ATTRIBUTE_UNUSED,
virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, -1);
+ if (cpu->model == NULL &&
+ VIR_STRDUP(cpu->model, "host") < 0)
+ return -1;
+
return 0;
}
--
1.9.3
9 years, 11 months
[libvirt] [PATCH] qxl: change the default value for vgamem_mb to 16 MiB
by Pavel Hrdina
The default value should be 16 MiB instead of 8 MiB. Only really old
version of upstream QEMU used the 8 MiB as default for vga framebuffer.
Without this change if you update your libvirt where we introduced the
"vgamem" attribute for QXL video device the value will be set to 8 MiB,
but previously your guest had 16 MiB because we didn't pass any value to
QEMU command line which means QEMU used its own 16 MiB as default.
This will affect all users with guest's display resolution higher than
1920x1080.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_command.h | 2 ++
src/qemu/qemu_domain.c | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 1930abd..101b88a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -12314,7 +12314,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
vid->vram = virDomainVideoDefaultRAM(def, vid->type);
if (vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL) {
vid->ram = virDomainVideoDefaultRAM(def, vid->type);
- vid->vgamem = 8 * 1024;
+ vid->vgamem = QEMU_QXL_VGAMEM_DEFAULT;
} else {
vid->ram = 0;
vid->vgamem = 0;
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index f7d3c2d..6246a85 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -55,6 +55,8 @@
# define QEMU_MIGRATION_PORT_MIN 49152
# define QEMU_MIGRATION_PORT_MAX 49215
+# define QEMU_QXL_VGAMEM_DEFAULT 16 * 1024
+
typedef struct _qemuBuildCommandLineCallbacks qemuBuildCommandLineCallbacks;
typedef qemuBuildCommandLineCallbacks *qemuBuildCommandLineCallbacksPtr;
struct _qemuBuildCommandLineCallbacks {
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 3d4023c..6416a28 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1178,7 +1178,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
goto cleanup;
}
} else {
- dev->data.video->vgamem = 8 * 1024;
+ dev->data.video->vgamem = QEMU_QXL_VGAMEM_DEFAULT;
}
}
--
2.0.5
9 years, 11 months
[libvirt] [PATCH v2] docs: Document some -boot option limitations on UEFI
by Michal Privoznik
It was brought to my attention that some -boot options may not
work with UEFI. For instance, rebootTimeout is very SeaBIOS
specific,splash logo is not implemented yet on OVMF, and so on.
We should document this limitation at least.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
diff to v1:
- Laszlo's suggestion worked in and smbios moved above the warning.
docs/formatdomain.html.in | 38 +++++++++++++++++++++++++-------------
1 file changed, 25 insertions(+), 13 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 499879e..0df2b76 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -174,6 +174,31 @@
elements are mutually exclusive. <span class="since">Since 0.1.3,
per-device boot since 0.8.8</span>
</dd>
+ <dt><code>smbios</code></dt>
+ <dd>How to populate SMBIOS information visible in the guest.
+ The <code>mode</code> attribute must be specified, and is either
+ "emulate" (let the hypervisor generate all values), "host" (copy
+ all of Block 0 and Block 1, except for the UUID, from the host's
+ SMBIOS values;
+ the <a href="html/libvirt-libvirt-host.html#virConnectGetSysinfo">
+ <code>virConnectGetSysinfo</code></a> call can be
+ used to see what values are copied), or "sysinfo" (use the values in
+ the <a href="#elementsSysinfo">sysinfo</a> element). If not
+ specified, the hypervisor default is used. <span class="since">
+ Since 0.8.7</span>
+ </dd>
+ </dl>
+ <p>Up till here the BIOS/UEFI configuration knobs are generic enough to
+ be implemented by majority (if not all) firmwares out there. However,
+ from now on not every single setting makes sense to all firmwares. For
+ instance, <code>rebootTimeout</code> doesn't make sense for UEFI,
+ <code>useserial</code> might not be usable with a BIOS firmware that
+ doesn't produce any output onto serial line, etc. Moreover, firmwares
+ don't usually export their capabilities for libvirt (or users) to check.
+ And the set of their capabilities can change with every new release.
+ Hence users are advised to try the settings they use before relying on
+ them in production.</p>
+ <dl>
<dt><code>bootmenu</code></dt>
<dd> Whether or not to enable an interactive boot menu prompt on guest
startup. The <code>enable</code> attribute can be either "yes" or "no".
@@ -184,19 +209,6 @@
in range [0, 65535] inclusive and it is ignored unless <code>enable</code>
is set to "yes". <span class="since">Since 1.2.8</span>
</dd>
- <dt><code>smbios</code></dt>
- <dd>How to populate SMBIOS information visible in the guest.
- The <code>mode</code> attribute must be specified, and is either
- "emulate" (let the hypervisor generate all values), "host" (copy
- all of Block 0 and Block 1, except for the UUID, from the host's
- SMBIOS values;
- the <a href="html/libvirt-libvirt-host.html#virConnectGetSysinfo">
- <code>virConnectGetSysinfo</code></a> call can be
- used to see what values are copied), or "sysinfo" (use the values in
- the <a href="#elementsSysinfo">sysinfo</a> element). If not
- specified, the hypervisor default is used. <span class="since">
- Since 0.8.7</span>
- </dd>
<dt><code>bios</code></dt>
<dd>This element has attribute <code>useserial</code> with possible
values <code>yes</code> or <code>no</code>. It enables or disables
--
2.0.5
9 years, 11 months
[libvirt] [PATCH v2] virsh: Emit error for VSH_OT_DATA without VSH_OFLAG_REQ
by Hao Liu
Commit 6b9964 enforces checking invalid use of VSH_OT_STRING with
VSH_OFLAG_REQ. This commit tries to do the same thing to stop using
VSH_OT_DATA without VSH_OFLAG_REQ and also fix existing misuse.
Signed-off-by: Hao Liu <hliu(a)redhat.com>
---
V2:
Add missing fix of dommemstat --period option.
tools/virsh-domain-monitor.c | 4 +--
tools/virsh-domain.c | 68 ++++++++++++++++++++++----------------------
tools/virsh-network.c | 6 ++--
tools/virsh-pool.c | 18 ++++++------
tools/virsh-snapshot.c | 20 ++++++-------
tools/virsh.c | 13 +++++++--
6 files changed, 68 insertions(+), 61 deletions(-)
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index 259400f..ace2c4a 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -271,7 +271,7 @@ static const vshCmdOptDef opts_dommemstat[] = {
.help = N_("domain name, id or uuid")
},
{.name = "period",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.flags = VSH_OFLAG_REQ_OPT,
.help = N_("period in seconds to set collection")
},
@@ -845,7 +845,7 @@ static const vshCmdOptDef opts_domblkstat[] = {
.help = N_("domain name, id or uuid")
},
{.name = "device",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.flags = VSH_OFLAG_EMPTY_OK,
.help = N_("block device")
},
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 750411b..6733cfa 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -755,27 +755,27 @@ static const vshCmdOptDef opts_attach_interface[] = {
.help = N_("source of network interface")
},
{.name = "target",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("target network name")
},
{.name = "mac",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("MAC address")
},
{.name = "script",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("script used to bridge network interface")
},
{.name = "model",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("model type")
},
{.name = "inbound",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("control domain's incoming traffics")
},
{.name = "outbound",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("control domain's outgoing traffics")
},
{.name = "persistent",
@@ -1749,7 +1749,7 @@ static const vshCmdOptDef opts_block_commit[] = {
.help = N_("bandwidth limit in MiB/s")
},
{.name = "base",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("path of base file to commit into (default bottom of chain)")
},
{.name = "shallow",
@@ -1757,7 +1757,7 @@ static const vshCmdOptDef opts_block_commit[] = {
.help = N_("use backing file of top as base")
},
{.name = "top",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("path of top file to commit from (default top of chain)")
},
{.name = "active",
@@ -1977,7 +1977,7 @@ static const vshCmdOptDef opts_block_copy[] = {
.help = N_("fully-qualified path of source disk")
},
{.name = "dest",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("path of the copy to create")
},
{.name = "bandwidth",
@@ -2025,11 +2025,11 @@ static const vshCmdOptDef opts_block_copy[] = {
.help = N_("with --wait, don't wait for cancel to finish")
},
{.name = "xml",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("filename containing XML description of the copy destination")
},
{.name = "format",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("format of the destination file")
},
{.name = "granularity",
@@ -2519,7 +2519,7 @@ static const vshCmdOptDef opts_block_pull[] = {
.help = N_("bandwidth limit in MiB/s")
},
{.name = "base",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("path of backing file in chain for a partial pull")
},
{.name = "wait",
@@ -3046,11 +3046,11 @@ static const vshCmdOptDef opts_domiftune[] = {
.help = N_("interface device (MAC Address)")
},
{.name = "inbound",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("control domain's incoming traffics")
},
{.name = "outbound",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("control domain's outgoing traffics")
},
{.name = "config",
@@ -3425,7 +3425,7 @@ static const vshCmdOptDef opts_undefine[] = {
.help = N_("remove domain managed state file")
},
{.name = "storage",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("remove associated storage volumes (comma separated list of "
"targets or source paths) (see domblklist)")
},
@@ -5019,7 +5019,7 @@ static const vshCmdOptDef opts_dump[] = {
.help = N_("dump domain's memory only")
},
{.name = "format",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("specify the format of memory-only dump")
},
{.name = NULL}
@@ -5173,7 +5173,7 @@ static const vshCmdOptDef opts_screenshot[] = {
.help = N_("domain name, id or uuid")
},
{.name = "file",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("where to store the screenshot")
},
{.name = "screen",
@@ -6217,7 +6217,7 @@ static const vshCmdOptDef opts_vcpupin[] = {
.help = N_("vcpu number")
},
{.name = "cpulist",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.flags = VSH_OFLAG_EMPTY_OK,
.help = N_("host cpu number(s) to set, or omit option to query")
},
@@ -6498,7 +6498,7 @@ static const vshCmdOptDef opts_emulatorpin[] = {
.help = N_("domain name, id or uuid")
},
{.name = "cpulist",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.flags = VSH_OFLAG_EMPTY_OK,
.help = N_("host cpu number(s) to set, or omit option to query")
},
@@ -7537,11 +7537,11 @@ static const vshCmdOptDef opts_metadata[] = {
.help = N_("use an editor to change the metadata")
},
{.name = "key",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("key to be used as a namespace identifier"),
},
{.name = "set",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("new metadata to set"),
},
{.name = "remove",
@@ -8326,12 +8326,12 @@ static const vshCmdOptDef opts_numatune[] = {
.help = N_("domain name, id or uuid")
},
{.name = "mode",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("NUMA mode, one of strict, preferred and interleave \n"
"or a number from the virDomainNumatuneMemMode enum")
},
{.name = "nodeset",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("NUMA node selections to set")
},
{.name = "config",
@@ -8602,11 +8602,11 @@ static const vshCmdInfo info_qemu_monitor_event[] = {
static const vshCmdOptDef opts_qemu_monitor_event[] = {
{.name = "domain",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("filter by domain name, id or uuid")
},
{.name = "event",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("filter by event name")
},
{.name = "pretty",
@@ -9416,19 +9416,19 @@ static const vshCmdOptDef opts_migrate[] = {
.help = N_("abort on soft errors during migration")
},
{.name = "migrateuri",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("migration URI, usually can be omitted")
},
{.name = "graphicsuri",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("graphics URI to be used for seamless graphics migration")
},
{.name = "listen-address",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("listen address that destination should bind to for incoming migration")
},
{.name = "dname",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("rename to new name during migration (if supported)")
},
{.name = "timeout",
@@ -9914,7 +9914,7 @@ static const vshCmdOptDef opts_domdisplay[] = {
.help = N_("includes the password into the connection URI if available")
},
{.name = "type",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("select particular graphical display "
"(e.g. \"vnc\", \"spice\", \"rdp\")")
},
@@ -11761,11 +11761,11 @@ static const vshCmdInfo info_event[] = {
static const vshCmdOptDef opts_event[] = {
{.name = "domain",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("filter by domain name, id, or uuid")
},
{.name = "event",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("which event type to wait for")
},
{.name = "all",
@@ -11923,7 +11923,7 @@ static const vshCmdOptDef opts_change_media[] = {
.help = N_("Fully-qualified path or target of disk device")
},
{.name = "source",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("source of the media")
},
{.name = "eject",
@@ -12074,7 +12074,7 @@ static const vshCmdOptDef opts_domfstrim[] = {
"free ranges smaller than this (Bytes)")
},
{.name = "mountpoint",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("which mount point to trim")
},
{.name = NULL}
diff --git a/tools/virsh-network.c b/tools/virsh-network.c
index 9dc52e5..5f8743c 100644
--- a/tools/virsh-network.c
+++ b/tools/virsh-network.c
@@ -1191,11 +1191,11 @@ static const vshCmdInfo info_network_event[] = {
static const vshCmdOptDef opts_network_event[] = {
{.name = "network",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("filter by network name or uuid")
},
{.name = "event",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("which event type to wait for")
},
{.name = "loop",
@@ -1305,7 +1305,7 @@ static const vshCmdOptDef opts_network_dhcp_leases[] = {
.help = N_("network name or uuid")
},
{.name = "mac",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.flags = VSH_OFLAG_NONE,
.help = N_("MAC address")
},
diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c
index a9482c4..addbccc 100644
--- a/tools/virsh-pool.c
+++ b/tools/virsh-pool.c
@@ -200,23 +200,23 @@ static const vshCmdOptDef opts_pool_X_as[] = {
.help = N_("print XML document, but don't define/create")
},
{.name = "source-host",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("source-host for underlying storage")
},
{.name = "source-path",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("source path for underlying storage")
},
{.name = "source-dev",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("source device for underlying storage")
},
{.name = "source-name",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("source name for underlying storage")
},
{.name = "target",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("target for underlying storage")
},
{.name = "source-format",
@@ -1399,15 +1399,15 @@ static const vshCmdOptDef opts_find_storage_pool_sources_as[] = {
.help = N_("type of storage pool sources to find")
},
{.name = "host",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("optional host to query")
},
{.name = "port",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("optional port to query")
},
{.name = "initiator",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("optional initiator IQN to use for query")
},
{.name = NULL}
@@ -1489,7 +1489,7 @@ static const vshCmdOptDef opts_find_storage_pool_sources[] = {
.help = N_("type of storage pool sources to discover")
},
{.name = "srcSpec",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("optional file of source xml to query for pools")
},
{.name = NULL}
diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c
index 9fe7751..1bb74a6 100644
--- a/tools/virsh-snapshot.c
+++ b/tools/virsh-snapshot.c
@@ -128,7 +128,7 @@ static const vshCmdOptDef opts_snapshot_create[] = {
.help = N_("domain name, id or uuid")
},
{.name = "xmlfile",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("domain snapshot XML")
},
{.name = "redefine",
@@ -333,11 +333,11 @@ static const vshCmdOptDef opts_snapshot_create_as[] = {
.help = N_("domain name, id or uuid")
},
{.name = "name",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("name of snapshot")
},
{.name = "description",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("description of snapshot")
},
{.name = "print-xml",
@@ -529,7 +529,7 @@ static const vshCmdOptDef opts_snapshot_edit[] = {
.help = N_("domain name, id or uuid")
},
{.name = "snapshotname",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("snapshot name")
},
{.name = "current",
@@ -658,7 +658,7 @@ static const vshCmdOptDef opts_snapshot_current[] = {
.help = N_("include security sensitive information in XML dump")
},
{.name = "snapshotname",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("name of existing snapshot to make current")
},
{.name = NULL}
@@ -886,7 +886,7 @@ static const vshCmdOptDef opts_snapshot_info[] = {
.help = N_("domain name, id or uuid")
},
{.name = "snapshotname",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("snapshot name")
},
{.name = "current",
@@ -1491,7 +1491,7 @@ static const vshCmdOptDef opts_snapshot_list[] = {
.help = N_("list snapshots in a tree")
},
{.name = "from",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("limit list to children of given snapshot")
},
{.name = "current",
@@ -1775,7 +1775,7 @@ static const vshCmdOptDef opts_snapshot_parent[] = {
.help = N_("domain name, id or uuid")
},
{.name = "snapshotname",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("find parent of snapshot name")
},
{.name = "current",
@@ -1843,7 +1843,7 @@ static const vshCmdOptDef opts_snapshot_revert[] = {
.help = N_("domain name, id or uuid")
},
{.name = "snapshotname",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("snapshot name")
},
{.name = "current",
@@ -1936,7 +1936,7 @@ static const vshCmdOptDef opts_snapshot_delete[] = {
.help = N_("domain name, id or uuid")
},
{.name = "snapshotname",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("snapshot name")
},
{.name = "current",
diff --git a/tools/virsh.c b/tools/virsh.c
index 0ead9ae..aba34ce 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -435,7 +435,7 @@ static const vshCmdInfo info_connect[] = {
static const vshCmdOptDef opts_connect[] = {
{.name = "name",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.flags = VSH_OFLAG_EMPTY_OK,
.help = N_("hypervisor connection URI")
},
@@ -594,7 +594,7 @@ static const vshCmdInfo info_help[] = {
static const vshCmdOptDef opts_help[] = {
{.name = "command",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("Prints global help, command specific help, or help for a group of related commands")
},
{.name = NULL}
@@ -854,7 +854,7 @@ static const vshCmdInfo info_cd[] = {
static const vshCmdOptDef opts_cd[] = {
{.name = "dir",
- .type = VSH_OT_DATA,
+ .type = VSH_OT_STRING,
.help = N_("directory to switch to (default: home or else root)")
},
{.name = NULL}
@@ -1392,6 +1392,13 @@ vshCmddefHelp(vshControl *ctl, const char *cmdname)
snprintf(buf, sizeof(buf), _("--%s <string>"), opt->name);
break;
case VSH_OT_DATA:
+ /* OT_DATA should always be VSH_OFLAG_REQ */
+ if (!(opt->flags & VSH_OFLAG_REQ)) {
+ vshError(ctl,
+ _("internal error: bad options in command: '%s'"),
+ def->name);
+ return false;
+ }
snprintf(buf, sizeof(buf), _("[--%s] <string>"),
opt->name);
break;
--
1.8.3.1
9 years, 11 months
[libvirt] [PATCH] qemu: Allow enabling/disabling features with host-passthrough
by Martin Kletzander
QEMU supports feature specification with -cpu host and we just skip
using that. Since QEMU developers themselves would like to use this
feature, this patch modifies the code to work.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1178850
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
docs/formatdomain.html.in | 5 +-
docs/schemas/domaincommon.rng | 67 ++++++++--------------
src/conf/cpu_conf.c | 53 +++++++++--------
src/qemu/qemu_command.c | 21 ++++---
...emuxml2argv-cpu-host-passthrough-features.args} | 2 +-
...qemuxml2argv-cpu-host-passthrough-features.xml} | 22 +------
tests/qemuxml2argvtest.c | 2 +-
tests/qemuxml2xmltest.c | 1 +
8 files changed, 71 insertions(+), 102 deletions(-)
rename tests/qemuxml2argvdata/{qemuxml2argv-cpu-host-passthrough-features-invalid.args => qemuxml2argv-cpu-host-passthrough-features.args} (91%)
rename tests/qemuxml2argvdata/{qemuxml2argv-cpu-host-passthrough-features-invalid.xml => qemuxml2argv-cpu-host-passthrough-features.xml} (57%)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 499879e..21a557e 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -970,6 +970,7 @@
<pre>
<cpu mode='host-passthrough'/>
+ <feature policy='disable' name='lahf_lm'/>
...</pre>
<p>
@@ -1071,8 +1072,8 @@
the same as the host CPU even in the aspects that libvirt does not
understand. Though the downside of this mode is that the guest
environment cannot be reproduced on different hardware. Thus, if you
- hit any bugs, you are on your own. Neither <code>model</code> nor
- <code>feature</code> elements are allowed in this mode.</dd>
+ hit any bugs, you are on your own. Further details of that CPU can
+ be changed using <code>feature</code> elements.</dd>
</dl>
In both <code>host-model</code> and <code>host-passthrough</code>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 879e064..85b3709 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -4088,50 +4088,29 @@
-->
<define name="cpu">
<element name="cpu">
- <choice>
- <group>
- <interleave>
- <optional>
- <ref name="cpuTopology"/>
- </optional>
- <optional>
- <ref name="cpuNuma"/>
- </optional>
- </interleave>
- </group>
- <group>
- <ref name="cpuMode"/>
- <interleave>
- <optional>
- <ref name="cpuModel"/>
- </optional>
- <optional>
- <ref name="cpuNuma"/>
- </optional>
- </interleave>
- </group>
- <group>
- <optional>
- <ref name="cpuMode"/>
- </optional>
- <ref name="cpuMatch"/>
- <interleave>
- <ref name="cpuModel"/>
- <optional>
- <ref name="cpuVendor"/>
- </optional>
- <optional>
- <ref name="cpuTopology"/>
- </optional>
- <zeroOrMore>
- <ref name="cpuFeature"/>
- </zeroOrMore>
- <optional>
- <ref name="cpuNuma"/>
- </optional>
- </interleave>
- </group>
- </choice>
+ <optional>
+ <ref name="cpuMode"/>
+ </optional>
+ <optional>
+ <ref name="cpuMatch"/>
+ </optional>
+ <interleave>
+ <optional>
+ <ref name="cpuModel"/>
+ </optional>
+ <optional>
+ <ref name="cpuVendor"/>
+ </optional>
+ <optional>
+ <ref name="cpuTopology"/>
+ </optional>
+ <zeroOrMore>
+ <ref name="cpuFeature"/>
+ </zeroOrMore>
+ <optional>
+ <ref name="cpuNuma"/>
+ </optional>
+ </interleave>
</element>
</define>
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 3af0f44..31fb458 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -1,7 +1,7 @@
/*
* cpu_conf.c: CPU XML handling
*
- * Copyright (C) 2009-2014 Red Hat, Inc.
+ * Copyright (C) 2009-2015 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -366,12 +366,8 @@ virCPUDefParseXML(xmlNodePtr node,
goto error;
if (n > 0) {
- if (!def->model && def->mode == VIR_CPU_MODE_HOST_PASSTHROUGH) {
- /* silently ignore incorrectly formatted features generated
- * by older libvirt */
- goto cleanup;
- }
- if (!def->model && def->mode != VIR_CPU_MODE_HOST_MODEL) {
+ if (!def->model && def->mode != VIR_CPU_MODE_HOST_MODEL &&
+ def->mode != VIR_CPU_MODE_HOST_PASSTHROUGH) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("Non-empty feature list specified without "
"CPU model"));
@@ -623,6 +619,7 @@ virCPUDefFormatBuf(virBufferPtr buf,
if (!def->model &&
def->mode != VIR_CPU_MODE_HOST_MODEL &&
+ def->mode != VIR_CPU_MODE_HOST_PASSTHROUGH &&
def->nfeatures) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Non-empty feature list specified without CPU model"));
@@ -663,30 +660,32 @@ virCPUDefFormatBuf(virBufferPtr buf,
virBufferAddLit(buf, "/>\n");
}
- for (i = 0; formatModel && i < def->nfeatures; i++) {
- virCPUFeatureDefPtr feature = def->features + i;
+ if (formatModel || def->mode == VIR_CPU_MODE_HOST_PASSTHROUGH) {
+ for (i = 0; i < def->nfeatures; i++) {
+ virCPUFeatureDefPtr feature = def->features + i;
- if (!feature->name) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Missing CPU feature name"));
- return -1;
- }
+ if (!feature->name) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Missing CPU feature name"));
+ return -1;
+ }
- if (def->type == VIR_CPU_TYPE_GUEST) {
- const char *policy;
+ if (def->type == VIR_CPU_TYPE_GUEST) {
+ const char *policy;
- policy = virCPUFeaturePolicyTypeToString(feature->policy);
- if (!policy) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected CPU feature policy %d"),
- feature->policy);
- return -1;
+ policy = virCPUFeaturePolicyTypeToString(feature->policy);
+ if (!policy) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unexpected CPU feature policy %d"),
+ feature->policy);
+ return -1;
+ }
+ virBufferAsprintf(buf, "<feature policy='%s' name='%s'/>\n",
+ policy, feature->name);
+ } else {
+ virBufferAsprintf(buf, "<feature name='%s'/>\n",
+ feature->name);
}
- virBufferAsprintf(buf, "<feature policy='%s' name='%s'/>\n",
- policy, feature->name);
- } else {
- virBufferAsprintf(buf, "<feature name='%s'/>\n",
- feature->name);
}
}
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 1930abd..83833ab 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6115,6 +6115,7 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
virCPUDefPtr host = NULL;
virCPUDefPtr guest = NULL;
virCPUDefPtr cpu = NULL;
+ virCPUDefPtr featCpu = NULL;
size_t ncpus = 0;
char **cpus = NULL;
virCPUDataPtr data = NULL;
@@ -6122,8 +6123,9 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
virCPUCompareResult cmp;
const char *preferred;
virCapsPtr caps = NULL;
- bool compareAgainstHost = (def->virtType == VIR_DOMAIN_VIRT_KVM ||
- def->cpu->mode != VIR_CPU_MODE_CUSTOM);
+ bool compareAgainstHost = ((def->virtType == VIR_DOMAIN_VIRT_KVM ||
+ def->cpu->mode != VIR_CPU_MODE_CUSTOM) &&
+ def->cpu->mode != VIR_CPU_MODE_HOST_PASSTHROUGH);
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
@@ -6141,7 +6143,7 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
if (!(cpu = virCPUDefCopy(def->cpu)))
goto cleanup;
- if (cpu->mode != VIR_CPU_MODE_CUSTOM &&
+ if (cpu->mode == VIR_CPU_MODE_HOST_MODEL &&
!migrating &&
cpuUpdate(cpu, host) < 0)
goto cleanup;
@@ -6200,6 +6202,8 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
if (ARCH_IS_PPC64(def->os.arch) &&
cpu->mode == VIR_CPU_MODE_HOST_MODEL) {
virBufferAsprintf(buf, ",compat=%s", def->cpu->model);
+ } else {
+ featCpu = cpu;
}
} else {
@@ -6225,18 +6229,21 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
if (VIR_STRDUP(guest->model, cpu->model) < 0)
goto cleanup;
}
-
virBufferAdd(buf, guest->model, -1);
if (guest->vendor_id)
virBufferAsprintf(buf, ",vendor=%s", guest->vendor_id);
- for (i = 0; i < guest->nfeatures; i++) {
+ featCpu = guest;
+ }
+
+ if (featCpu) {
+ for (i = 0; i < featCpu->nfeatures; i++) {
char sign;
- if (guest->features[i].policy == VIR_CPU_FEATURE_DISABLE)
+ if (featCpu->features[i].policy == VIR_CPU_FEATURE_DISABLE)
sign = '-';
else
sign = '+';
- virBufferAsprintf(buf, ",%c%s", sign, guest->features[i].name);
+ virBufferAsprintf(buf, ",%c%s", sign, featCpu->features[i].name);
}
}
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features-invalid.args b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features.args
similarity index 91%
rename from tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features-invalid.args
rename to tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features.args
index 18c1dce..88a25bf 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features-invalid.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features.args
@@ -8,7 +8,7 @@ IO_DRV=none \
/usr/bin/qemu \
-S \
-M pc \
--cpu host \
+-cpu host,+abm,+ds,-invtsc \
-m 214 \
-smp 1 \
-nographic \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features-invalid.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features.xml
similarity index 57%
rename from tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features-invalid.xml
rename to tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features.xml
index b5f5326..e807dbd 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features-invalid.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-host-passthrough-features.xml
@@ -15,26 +15,8 @@
</os>
<cpu mode='host-passthrough'>
<feature policy='require' name='abm'/>
- <feature policy='require' name='pdpe1gb'/>
- <feature policy='require' name='rdrand'/>
- <feature policy='require' name='f16c'/>
- <feature policy='require' name='osxsave'/>
- <feature policy='require' name='pdcm'/>
- <feature policy='require' name='xtpr'/>
- <feature policy='require' name='tm2'/>
- <feature policy='require' name='est'/>
- <feature policy='require' name='smx'/>
- <feature policy='require' name='vmx'/>
- <feature policy='require' name='ds_cpl'/>
- <feature policy='require' name='monitor'/>
- <feature policy='require' name='dtes64'/>
- <feature policy='require' name='pbe'/>
- <feature policy='require' name='tm'/>
- <feature policy='require' name='ht'/>
- <feature policy='require' name='ss'/>
- <feature policy='require' name='acpi'/>
- <feature policy='require' name='ds'/>
- <feature policy='require' name='vme'/>
+ <feature policy='force' name='ds'/>
+ <feature policy='disable' name='invtsc'/>
</cpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index bce88a8..1d0bd61 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1524,7 +1524,7 @@ mymain(void)
DO_TEST_FAILURE("shmem-small-size", QEMU_CAPS_PCIDEVICE,
QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_IVSHMEM);
DO_TEST_PARSE_ERROR("shmem-msi-only", NONE);
- DO_TEST("cpu-host-passthrough-features-invalid", QEMU_CAPS_KVM, QEMU_CAPS_CPU_HOST);
+ DO_TEST("cpu-host-passthrough-features", QEMU_CAPS_KVM, QEMU_CAPS_CPU_HOST);
virObjectUnref(driver.config);
virObjectUnref(driver.caps);
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index e1ec514..1166534 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -184,6 +184,7 @@ mymain(void)
DO_TEST("clock-localtime");
DO_TEST("cpu-kvmclock");
DO_TEST("cpu-host-kvmclock");
+ DO_TEST("cpu-host-passthrough-features");
DO_TEST("clock-catchup");
DO_TEST("kvmclock");
DO_TEST("clock-timer-hyperv-rtc");
--
2.2.1
9 years, 11 months
[libvirt] [PATCH v2 1/2] lxc: Move setting ifname_guest_actual to virLXCSetupInterfaces
by Guido Günther
so it applies to interfaces of type 'direct' too.
Reported and patch provided by Bastian Blank at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769600
---
src/lxc/lxc_process.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index d7eb8bc..af08de9 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -260,8 +260,6 @@ char *virLXCProcessSetupInterfaceBridged(virConnectPtr conn,
if (virNetDevSetMAC(containerVeth, &net->mac) < 0)
goto cleanup;
- if (VIR_STRDUP(net->ifname_guest_actual, containerVeth) < 0)
- goto cleanup;
if (vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) {
if (virNetDevOpenvswitchAddPort(brname, parentVeth, &net->mac,
@@ -432,6 +430,9 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
(*veths)[(*nveths)-1] = veth;
+ if (VIR_STRDUP(def->nets[i]->ifname_guest_actual, veth) < 0)
+ goto cleanup;
+
/* Make sure all net definitions will have a name in the container */
if (!net->ifname_guest) {
if (virAsprintf(&net->ifname_guest, "eth%zu", niface) < 0)
--
2.1.4
9 years, 11 months
[libvirt] [PATCH V4 0/5] support sending sysrq key
by Chunyan Liu
xend/libxl support sending sysrq key to guest kernel but not support
sending any key sequence as virDomainSendKey is expected to do. To
add equivalant sysrq functionality in libvirt for xen/libxl, add a new
virDomainSendSysrq API and add related codes to virsh, remote driver,
xen/libxl driver.
Changes to V3:
* fix some memory leak
Not change:
virDomainSendSysrq parameter still keeps "char key" rather than "enum
key", main reason to keep it because: sysrq key is different to different
kinds of guests, xen hypervisor doesn't know the correct enum <-> letter
mapping towards different guests, it just sends the key blindly to guests.
See:
http://www.redhat.com/archives/libvir-list/2015-January/msg00132.html
V3 is here:
http://www.redhat.com/archives/libvir-list/2014-December/msg00882.html
Chunyan Liu (5):
Add public API virDomainSendSysrq
implement remote protocol for domainSendSysrq
virsh: add 'sysrq' command
libxl: implement .domainSendSysrq method
xen: add .domainSendSysrq method
include/libvirt/libvirt-domain.h | 3 +++
src/driver-hypervisor.h | 4 +++
src/libvirt-domain.c | 39 +++++++++++++++++++++++++++
src/libvirt_public.syms | 5 ++++
src/libxl/libxl_driver.c | 25 ++++++++++++++++++
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 14 +++++++++-
src/remote_protocol-structs | 6 +++++
src/rpc/gendispatch.pl | 12 +++++++++
src/xen/xen_driver.c | 21 +++++++++++++++
src/xen/xend_internal.c | 30 +++++++++++++++++++++
src/xen/xend_internal.h | 1 +
tools/virsh-domain.c | 57 ++++++++++++++++++++++++++++++++++++++++
13 files changed, 217 insertions(+), 1 deletion(-)
--
1.8.4.5
9 years, 11 months