[libvirt] [PATCH 0/2] virtlo(ck|g)d: Two simple improvements
by Erik Skultety
Erik Skultety (2):
daemon: virtlogd: Drop the server shortcut ref pointer
daemon: virtlockd: Call virNetDaemonGetServer regardless of post exec
src/locking/lock_daemon.c | 5 +++--
src/logging/log_daemon.c | 54 ++++++++++++++++++++++++++++-------------------
2 files changed, 35 insertions(+), 24 deletions(-)
--
2.13.6
7 years
[libvirt] [PATCH] hooks: Fix a wrong description
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)gmail.com>
In the definition of virHookQemuOpType and virHookNetworkOpType,
we should use 'stopped' rather than 'shutdown'.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)gmail.com>
---
docs/hooks.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/hooks.html.in b/docs/hooks.html.in
index 05156c30c..2c4c39b77 100644
--- a/docs/hooks.html.in
+++ b/docs/hooks.html.in
@@ -316,7 +316,7 @@
executes <b>prior</b> to the object (guest or network) being created.
This allows the object start operation to be aborted if the script
returns indicating failure.<br/><br/></li>
- <li>The "shutdown" operation for the guest and network hook scripts,
+ <li>The "stopped" operation for the guest and network hook scripts,
executes <b>after</b> the object (guest or network) has stopped. If
the hook script indicates failure in its return, the shut down of the
object cannot be aborted because it has already been performed.
--
2.13.6
7 years
[libvirt] [PATCH] qemuBuildDriveDevStr: Prefer default aliases for IDE bus
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1434451
When testing user aliases it was discovered that for 440fx
machine type which has default IDE bus builtin, domain cannot
start if IDE controller has the user provided alias. This is
because for 440fx we don't put the IDE controller onto the
command line (since it is builtin) and therefore any device that
is plugged onto the bus must use the default alias.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_command.c | 14 +++++++++++---
tests/qemuxml2argvdata/qemuxml2argv-user-aliases.args | 4 ++--
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 364196783..6cc77df2e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1886,9 +1886,17 @@ qemuBuildDriveDevStr(const virDomainDef *def,
virBufferAddLit(&opt, "ide-drive");
}
- if (!(contAlias = virDomainControllerAliasFind(def, VIR_DOMAIN_CONTROLLER_TYPE_IDE,
- disk->info.addr.drive.controller)))
- goto error;
+ /* When domain has builtin IDE controller we don't put it onto cmd
+ * line. Therefore we can't set its alias. In that case, use the
+ * default one. */
+ if (qemuDomainHasBuiltinIDE(def)) {
+ contAlias = "ide";
+ } else {
+ if (!(contAlias = virDomainControllerAliasFind(def,
+ VIR_DOMAIN_CONTROLLER_TYPE_IDE,
+ disk->info.addr.drive.controller)))
+ goto error;
+ }
virBufferAsprintf(&opt, ",bus=%s.%d,unit=%d",
contAlias,
disk->info.addr.drive.bus,
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.args b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.args
index 62fbd567b..1719c1bc8 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-user-aliases.args
@@ -44,8 +44,8 @@ id=drive-ua-myEncryptedDisk1 \
id=ua-myEncryptedDisk1 \
-drive file=/home/zippy/tmp/install-amd64-minimal-20140619.iso,format=raw,\
if=none,media=cdrom,id=drive-ua-WhatAnAwesomeCDROM,readonly=on,cache=none \
--device ide-drive,bus=ua-DoesAnybodyStillUseIDE.1,unit=0,\
-drive=drive-ua-WhatAnAwesomeCDROM,id=ua-WhatAnAwesomeCDROM \
+-device ide-drive,bus=ide.1,unit=0,drive=drive-ua-WhatAnAwesomeCDROM,\
+id=ua-WhatAnAwesomeCDROM \
-device virtio-net-pci,vlan=0,id=ua-CheckoutThisNIC,mac=52:54:00:d6:c0:0b,\
bus=pci.0,addr=0x3 \
-net tap,fd=3,vlan=0,name=hostua-CheckoutThisNIC \
--
2.13.6
7 years
[libvirt] [PATCH 0/4] qemu: Enable configuration of HPT resizing for pSeries guests
by Andrea Bolognani
Applies on top of
https://www.redhat.com/archives/libvir-list/2017-November/msg00176.html
Andrea Bolognani (4):
qemu: Enable configuration of HPT resizing for pSeries guests
tests: Add tests for configuration of HPT resizing
docs: Document configuration of HPT resizing
news: Update for configuration of HPT resizing
docs/formatdomain.html.in | 13 +++++-
docs/news.xml | 10 +++++
docs/schemas/domaincommon.rng | 15 +++++++
src/conf/domain_conf.c | 46 +++++++++++++++++++++-
src/conf/domain_conf.h | 12 ++++++
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 8 ++++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 20 ++++++++++
src/qemu/qemu_domain.c | 8 ++++
tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 +
...qemuxml2argv-pseries-hpt-resizing-disabled.args | 20 ++++++++++
.../qemuxml2argv-pseries-hpt-resizing-disabled.xml | 19 +++++++++
.../qemuxml2argv-pseries-hpt-resizing-enabled.args | 20 ++++++++++
.../qemuxml2argv-pseries-hpt-resizing-enabled.xml | 19 +++++++++
...l2argv-pseries-hpt-resizing-invalid-machine.xml | 18 +++++++++
...qemuxml2argv-pseries-hpt-resizing-required.args | 20 ++++++++++
.../qemuxml2argv-pseries-hpt-resizing-required.xml | 19 +++++++++
tests/qemuxml2argvtest.c | 20 ++++++++++
...emuxml2xmlout-pseries-hpt-resizing-disabled.xml | 28 +++++++++++++
...qemuxml2xmlout-pseries-hpt-resizing-enabled.xml | 28 +++++++++++++
...emuxml2xmlout-pseries-hpt-resizing-required.xml | 28 +++++++++++++
tests/qemuxml2xmltest.c | 13 ++++++
23 files changed, 385 insertions(+), 2 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-disabled.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-disabled.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-enabled.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-enabled.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-invalid-machine.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-required.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hpt-resizing-required.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-disabled.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-enabled.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hpt-resizing-required.xml
--
2.13.6
7 years
[libvirt] [PATCH] vircapstest: Avoid (im)possible strcmp call with NULL argument
by Jiri Denemark
Some compiler may get confused and decide we are calling strcmp with
NULL argument from test_virCapsDomainDataLookupLXC. Although this does
not really happen since the call is guarded with
(data->machinetype != expect_machinetype), using STRNEQ_NULLABLE is
easier to understand, less fragile, and doing so makes sure strcmp is
never called with NULL argument.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
tests/vircapstest.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tests/vircapstest.c b/tests/vircapstest.c
index 95829133d0..05ec802f35 100644
--- a/tests/vircapstest.c
+++ b/tests/vircapstest.c
@@ -188,11 +188,10 @@ doCapsCompare(virCapsPtr caps,
goto error;
}
- if (data->machinetype != expect_machinetype &&
- STRNEQ(data->machinetype, expect_machinetype)) {
+ if (STRNEQ_NULLABLE(data->machinetype, expect_machinetype)) {
fprintf(stderr, "data->machinetype=%s doesn't match "
"expect_machinetype=%s\n",
- data->machinetype, expect_machinetype);
+ NULLSTR(data->machinetype), NULLSTR(expect_machinetype));
goto error;
}
--
2.15.0
7 years
[libvirt] [PATCH go-xml] Add support for panic device
by zhenwei.pi
Add DomainAddressISA for panic device address.
Add DomainPanic.
Add test code.
Signed-off-by: zhenwei.pi <zhenwei.pi(a)youruncloud.com>
---
domain.go | 38 ++++++++++++++++++++++++++++++++++++++
domain_test.go | 28 +++++++++++++++++++++++++---
2 files changed, 63 insertions(+), 3 deletions(-)
diff --git a/domain.go b/domain.go
index f4ef35c..8086e28 100644
--- a/domain.go
+++ b/domain.go
@@ -312,11 +312,16 @@ type DomainAddressDIMM struct {
Base *uint64 `xml:"base,attr"`
}
+type DomainAddressISA struct {
+ Iobase *uint `xml:"iobase,attr"`
+}
+
type DomainAddress struct {
USB *DomainAddressUSB
PCI *DomainAddressPCI
Drive *DomainAddressDrive
DIMM *DomainAddressDIMM
+ ISA *DomainAddressISA
}
type DomainConsole struct {
@@ -403,6 +408,12 @@ type DomainMemBalloon struct {
Address *DomainAddress `xml:"address"`
}
+type DomainPanic struct {
+ XMLName xml.Name `xml:"panic"`
+ Model string `xml:"model,attr"`
+ Address *DomainAddress `xml:"address"`
+}
+
type DomainSoundCodec struct {
Type string `xml:"type,attr"`
}
@@ -486,6 +497,7 @@ type DomainDeviceList struct {
Videos []DomainVideo `xml:"video"`
Channels []DomainChannel `xml:"channel"`
MemBalloon *DomainMemBalloon `xml:"memballoon"`
+ Panics []DomainPanic `xml:"panic"`
Sounds []DomainSound `xml:"sound"`
RNGs []DomainRNG `xml:"rng"`
Hostdevs []DomainHostdev `xml:"hostdev"`
@@ -1058,6 +1070,16 @@ func (a *DomainAddressDIMM) MarshalXML(e *xml.Encoder, start xml.StartElement) e
return nil
}
+func (a *DomainAddressISA) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
+ start.Attr = append(start.Attr, xml.Attr{
+ xml.Name{Local: "type"}, "isa",
+ })
+ marshallUintAttr(&start, "iobase", a.Iobase, 16)
+ e.EncodeToken(start)
+ e.EncodeToken(start.End())
+ return nil
+}
+
func (a *DomainAddress) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
if a.USB != nil {
return a.USB.MarshalXML(e, start)
@@ -1067,6 +1089,8 @@ func (a *DomainAddress) MarshalXML(e *xml.Encoder, start xml.StartElement) error
return a.Drive.MarshalXML(e, start)
} else if a.DIMM != nil {
return a.DIMM.MarshalXML(e, start)
+ } else if a.ISA != nil {
+ return a.ISA.MarshalXML(e, start)
} else {
return nil
}
@@ -1173,6 +1197,17 @@ func (a *DomainAddressDIMM) UnmarshalXML(d *xml.Decoder, start xml.StartElement)
return nil
}
+func (a *DomainAddressISA) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
+ for _, attr := range start.Attr {
+ if attr.Name.Local == "iobase" {
+ if err := unmarshallUintAttr(attr.Value, &a.Iobase, 16); err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+}
+
func (a *DomainAddress) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
var typ string
d.Skip()
@@ -1198,6 +1233,9 @@ func (a *DomainAddress) UnmarshalXML(d *xml.Decoder, start xml.StartElement) err
} else if typ == "dimm" {
a.DIMM = &DomainAddressDIMM{}
return a.DIMM.UnmarshalXML(d, start)
+ } else if typ == "isa" {
+ a.ISA = &DomainAddressISA{}
+ return a.ISA.UnmarshalXML(d, start)
}
return nil
diff --git a/domain_test.go b/domain_test.go
index 1ad5125..31787a5 100644
--- a/domain_test.go
+++ b/domain_test.go
@@ -45,6 +45,10 @@ type DriveAddress struct {
Unit uint
}
+type ISAAddress struct {
+ Iobase uint
+}
+
var uhciIndex uint = 0
var uhciAddr = PCIAddress{0, 0, 1, 2}
@@ -53,6 +57,7 @@ var ifaceAddr = PCIAddress{0, 0, 4, 0}
var videoAddr = PCIAddress{0, 0, 5, 0}
var fsAddr = PCIAddress{0, 0, 6, 0}
var balloonAddr = PCIAddress{0, 0, 7, 0}
+var panicAddr = ISAAddress{0x505}
var duplexAddr = PCIAddress{0, 0, 8, 0}
var hostdevSCSI = DriveAddress{0, 0, 3, 0}
@@ -303,6 +308,19 @@ var domainTestData = []struct {
},
},
},
+ Panics: []DomainPanic{
+ DomainPanic{
+ Model: "hyperv",
+ },
+ DomainPanic{
+ Model: "isa",
+ Address: &DomainAddress{
+ ISA: &DomainAddressISA{
+ Iobase: &panicAddr.Iobase,
+ },
+ },
+ },
+ },
Consoles: []DomainConsole{
DomainConsole{
Type: "pty",
@@ -433,6 +451,10 @@ var domainTestData = []struct {
` <memballoon model="virtio">`,
` <address type="pci" domain="0x0" bus="0x0" slot="0x7" function="0x0"></address>`,
` </memballoon>`,
+ ` <panic model="hyperv"></panic>`,
+ ` <panic model="isa">`,
+ ` <address type="isa" iobase="0x505"></address>`,
+ ` </panic>`,
` <sound model="ich6">`,
` <codec type="duplex"></codec>`,
` <address type="pci" domain="0x0" bus="0x0" slot="0x8" function="0x0"></address>`,
@@ -1725,9 +1747,9 @@ var domainTestData = []struct {
/* Host Bootloader -- bhyve, Xen */
{
Object: &Domain{
- Type: "bhyve",
- Name: "test",
- Bootloader: "/usr/local/sbin/grub-bhyve",
+ Type: "bhyve",
+ Name: "test",
+ Bootloader: "/usr/local/sbin/grub-bhyve",
BootloaderArgs: "-r cd0 -m /tmp/test-device.map -M 1024M linuxguest",
},
Expected: []string{
--
2.7.4
7 years
[libvirt] [PATCH] virhostcpu: Report correct topolgy info on host with deconfigured core
by Nitesh Konkar
The host which has a deconfigured core is treated as though the topology is
not correct and the SMT is not reliable. Which is not true, so report the topology
correctly by detecting if the host is actually in a proper SMT mode with
the deconfigured core.
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
Steps to reproduce:
This is what `virsh capabilities` shows in a
10-core POWER8 system (8 threads per core):
$ virsh capabilities | grep threads
<topology sockets='1' cores='10' threads='8'/>
There are 10 CPUs online, given SMT is off (`ppc64_cpu --smt=off`):
$ cat /sys/devices/system/cpu/online
0,8,16,24,32,40,48,56,64,72
Now, if one core is disabled/offlined (e.g., the last one, number 72)...
$ echo 0 | sudo tee /sys/devices/system/cpu/cpu72/online
Then this messes up with `virsh capabilities` number of cores (now 80) and threads (now 1) :
$ virsh capabilities | grep threads
<topology sockets='1' cores='80' threads='1'/>
It goes back to normal if that CPU is enabled/onlined again:
$ echo 1 | sudo tee /sys/devices/system/cpu/cpu72/online
1
$ virsh capabilities | grep threads
<topology sockets='1' cores='10' threads='8'/>
src/util/virhostcpu.c | 8 ++++++--
tests/virhostcpudata/linux-ppc64-deconf-cpus.expected | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index c485a97..5301583 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -524,6 +524,7 @@ virHostCPUGetInfoPopulateLinux(FILE *cpuinfo,
DIR *nodedir = NULL;
struct dirent *nodedirent = NULL;
int nodecpus, nodecores, nodesockets, nodethreads, offline = 0;
+ int total_online_cpus = 0;
int threads_per_subcore = 0;
unsigned int node;
int ret = -1;
@@ -623,6 +624,8 @@ virHostCPUGetInfoPopulateLinux(FILE *cpuinfo,
if (!online_cpus_map)
goto cleanup;
+ total_online_cpus = virBitmapCountBits(online_cpus_map);
+
/* OK, we've parsed clock speed out of /proc/cpuinfo. Get the
* core, node, socket, thread and topology information from /sys
*/
@@ -746,10 +749,11 @@ virHostCPUGetInfoPopulateLinux(FILE *cpuinfo,
* the nodeinfo structure isn't designed to carry the full topology so
* we're going to lie about the detected topology to notify the user
* to check the host capabilities for the actual topology. */
- if ((*nodes *
+ if (((*nodes *
*sockets *
*cores *
- *threads) != (*cpus + offline)) {
+ *threads) != (*cpus + offline)) &&
+ ((total_online_cpus * threads_per_subcore) != (*cpus + offline))) {
*nodes = 1;
*sockets = 1;
*cores = *cpus + offline;
diff --git a/tests/virhostcpudata/linux-ppc64-deconf-cpus.expected b/tests/virhostcpudata/linux-ppc64-deconf-cpus.expected
index 113bfa8..7998a8f 100644
--- a/tests/virhostcpudata/linux-ppc64-deconf-cpus.expected
+++ b/tests/virhostcpudata/linux-ppc64-deconf-cpus.expected
@@ -1 +1 @@
-CPUs: 80/80, MHz: 3690, Nodes: 1, Sockets: 1, Cores: 80, Threads: 1
+CPUs: 80/96, MHz: 3690, Nodes: 4, Sockets: 1, Cores: 3, Threads: 8
--
1.8.3.1
7 years
[libvirt] [PATCH v2 1/2] remote: set neventCallbacks to zero at DEREG_CB
by xinhua.Cao
set neventCallbacks to zero after VIR_FREE(eventCallbacks) was called
---
daemon/remote.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/daemon/remote.c b/daemon/remote.c
index 07557e9..cbcb6e8 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -1686,6 +1686,7 @@ void remoteRelayConnectionClosedEvent(virConnectPtr conn ATTRIBUTE_UNUSED, int r
VIR_WARN("unexpected %s event deregister failure", name); \
} \
VIR_FREE(eventCallbacks); \
+ neventCallbacks = 0; \
} while (0);
/*
--
2.8.3
7 years
[libvirt] [PATCH] qemu: Properly report errors from qemuDomainFixupCPUs
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 6d7827220e..a36e157529 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -10227,7 +10227,7 @@ qemuDomainFixupCPUs(virDomainObjPtr vm,
virCPUDefPtr fixedCPU = NULL;
virCPUDefPtr fixedOrig = NULL;
virArch arch = vm->def->os.arch;
- int ret = 0;
+ int ret = -1;
if (!ARCH_IS_X86(arch))
return 0;
--
2.15.0
7 years
[libvirt] [PATCH] Revert "virNetDevSupportBandwidth: Enable QoS for vhostuser"
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1497410
This reverts commit bc8a99ef06417a2303ccab455f9f045e2a617916.
The vhostuser is not a TAP. Therefore our QoS code is not able to
set any bandwidth. I don't really understand what I was thinking.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/netdev_bandwidth_conf.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/netdev_bandwidth_conf.h b/src/conf/netdev_bandwidth_conf.h
index c37828065..30f988953 100644
--- a/src/conf/netdev_bandwidth_conf.h
+++ b/src/conf/netdev_bandwidth_conf.h
@@ -46,9 +46,9 @@ static inline bool virNetDevSupportBandwidth(virDomainNetType type)
case VIR_DOMAIN_NET_TYPE_NETWORK:
case VIR_DOMAIN_NET_TYPE_DIRECT:
case VIR_DOMAIN_NET_TYPE_ETHERNET:
- case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
return true;
case VIR_DOMAIN_NET_TYPE_USER:
+ case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
--
2.13.6
7 years