[libvirt PATCH v2 1/2] esx: generator: add GuestNicInfo object
by Pino Toscano
Add the definition of the GuestNicInfo object, with all the required
objects for it.
Signed-off-by: Pino Toscano <ptoscano(a)redhat.com>
---
scripts/esx_vi_generator.py | 1 +
src/esx/esx_vi_generator.input | 54 ++++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+)
diff --git a/scripts/esx_vi_generator.py b/scripts/esx_vi_generator.py
index e0782e35f3..7929e1e682 100755
--- a/scripts/esx_vi_generator.py
+++ b/scripts/esx_vi_generator.py
@@ -1292,6 +1292,7 @@ additional_object_features = {
"DatastoreHostMount": (Object.FEATURE__DEEP_COPY | Object.FEATURE__LIST |
Object.FEATURE__ANY_TYPE),
"DatastoreInfo": Object.FEATURE__ANY_TYPE | Object.FEATURE__DYNAMIC_CAST,
+ "GuestNicInfo": Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE,
"HostConfigManager": Object.FEATURE__ANY_TYPE,
"HostCpuIdInfo": Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE,
"HostDatastoreBrowserSearchResults": (Object.FEATURE__LIST |
diff --git a/src/esx/esx_vi_generator.input b/src/esx/esx_vi_generator.input
index 22c114e0aa..bd6ac72a18 100644
--- a/src/esx/esx_vi_generator.input
+++ b/src/esx/esx_vi_generator.input
@@ -277,6 +277,18 @@ object FolderFileQuery extends FileQuery
end
+object GuestNicInfo
+ Boolean connected r
+ Int deviceConfigId r
+ NetDnsConfigInfo dnsConfig o
+ String ipAddress ol
+ NetIpConfigInfo ipConfig o
+ String macAddress o
+ NetBIOSConfigInfo netBIOSConfig o
+ String network o
+end
+
+
object HostAutoStartManagerConfig
AutoStartDefaults defaults o
AutoStartPowerInfo powerInfo ol
@@ -770,6 +782,48 @@ object NasDatastoreInfo extends DatastoreInfo
end
+object NetBIOSConfigInfo
+ String mode r
+end
+
+
+object NetDhcpConfigInfo
+ NetDhcpConfigInfoDhcpOptions ipv4 o
+ NetDhcpConfigInfoDhcpOptions ipv6 o
+end
+
+
+object NetDhcpConfigInfoDhcpOptions
+ KeyAnyValue config ol
+ Boolean enable r
+end
+
+
+object NetDnsConfigInfo
+ Boolean dhcp r
+ String domainName r
+ String hostName r
+ String ipAddress ol
+ String searchDomain ol
+end
+
+
+object NetIpConfigInfo
+ Boolean autoConfigurationEnabled o
+ NetDhcpConfigInfo dhcp o
+ NetIpConfigInfoIpAddress ipAddress ol
+end
+
+
+object NetIpConfigInfoIpAddress
+ String ipAddress r
+ DateTime lifetime o
+ String origin o
+ Int prefixLength r
+ String state o
+end
+
+
object ObjectContent
ManagedObjectReference obj r
DynamicProperty propSet ol
--
2.26.2
4 years, 2 months
[libvirt PATCH v2] esx: implement connectListAllNetworks
by Pino Toscano
Implement the .connectListAllNetworks networks API in the esx network
driver.
Signed-off-by: Pino Toscano <ptoscano(a)redhat.com>
---
src/esx/esx_network_driver.c | 69 ++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+)
diff --git a/src/esx/esx_network_driver.c b/src/esx/esx_network_driver.c
index 88843aae2f..a4e738ba72 100644
--- a/src/esx/esx_network_driver.c
+++ b/src/esx/esx_network_driver.c
@@ -863,6 +863,74 @@ esxNetworkIsPersistent(virNetworkPtr network G_GNUC_UNUSED)
+#define MATCH(FLAG) (flags & (FLAG))
+static int
+esxConnectListAllNetworks(virConnectPtr conn,
+ virNetworkPtr **nets,
+ unsigned int flags)
+{
+ int ret = -1;
+ esxPrivate *priv = conn->privateData;
+ esxVI_HostVirtualSwitch *hostVirtualSwitchList = NULL;
+ esxVI_HostVirtualSwitch *hostVirtualSwitch = NULL;
+ size_t count = 0;
+ size_t i;
+
+ virCheckFlags(VIR_CONNECT_LIST_NETWORKS_FILTERS_ALL, -1);
+
+ /*
+ * ESX networks are always active, persistent, and
+ * autostarted, so return zero elements in case we are asked
+ * for networks different than that.
+ */
+ if (MATCH(VIR_CONNECT_LIST_NETWORKS_FILTERS_ACTIVE) &&
+ !(MATCH(VIR_CONNECT_LIST_NETWORKS_ACTIVE)))
+ return 0;
+ if (MATCH(VIR_CONNECT_LIST_NETWORKS_FILTERS_PERSISTENT) &&
+ !(MATCH(VIR_CONNECT_LIST_NETWORKS_PERSISTENT)))
+ return 0;
+ if (MATCH(VIR_CONNECT_LIST_NETWORKS_FILTERS_AUTOSTART) &&
+ !(MATCH(VIR_CONNECT_LIST_NETWORKS_AUTOSTART)))
+ return 0;
+
+ if (esxVI_EnsureSession(priv->primary) < 0 ||
+ esxVI_LookupHostVirtualSwitchList(priv->primary,
+ &hostVirtualSwitchList) < 0) {
+ return -1;
+ }
+
+ for (hostVirtualSwitch = hostVirtualSwitchList; hostVirtualSwitch;
+ hostVirtualSwitch = hostVirtualSwitch->_next) {
+ if (nets) {
+ virNetworkPtr net = virtualswitchToNetwork(conn, hostVirtualSwitch);
+ if (!net)
+ goto cleanup;
+ if (VIR_APPEND_ELEMENT(*nets, count, net) < 0)
+ goto cleanup;
+ } else {
+ ++count;
+ }
+ }
+
+ ret = count;
+
+ cleanup:
+ if (ret < 0) {
+ if (nets && *nets) {
+ for (i = 0; i < count; ++i)
+ VIR_FREE((*nets)[i]);
+ VIR_FREE(*nets);
+ }
+ }
+
+ esxVI_HostVirtualSwitch_Free(&hostVirtualSwitchList);
+
+ return ret;
+}
+#undef MATCH
+
+
+
virNetworkDriver esxNetworkDriver = {
.connectNumOfNetworks = esxConnectNumOfNetworks, /* 0.10.0 */
.connectListNetworks = esxConnectListNetworks, /* 0.10.0 */
@@ -877,4 +945,5 @@ virNetworkDriver esxNetworkDriver = {
.networkSetAutostart = esxNetworkSetAutostart, /* 0.10.0 */
.networkIsActive = esxNetworkIsActive, /* 0.10.0 */
.networkIsPersistent = esxNetworkIsPersistent, /* 0.10.0 */
+ .connectListAllNetworks = esxConnectListAllNetworks, /* 6.8.0 */
};
--
2.26.2
4 years, 2 months
[libvirt PATCH 0/3] virsh-completer: Use Glib memory functions (glib chronicles)
by Ján Tomko
Ján Tomko (3):
virsh-completer: use g_clear_pointer in virshCommaStringListComplete
virsh-completer: use g_free instead of VIR_FREE
virsh-completer: use g_new0 instead of VIR_ALLOC_N
tools/virsh-completer-checkpoint.c | 11 ++++----
tools/virsh-completer-domain.c | 44 ++++++++++--------------------
tools/virsh-completer-host.c | 6 ++--
tools/virsh-completer-interface.c | 6 ++--
tools/virsh-completer-network.c | 25 +++++++----------
tools/virsh-completer-nodedev.c | 12 +++-----
tools/virsh-completer-nwfilter.c | 12 +++-----
tools/virsh-completer-pool.c | 12 +++-----
tools/virsh-completer-secret.c | 8 ++----
tools/virsh-completer-snapshot.c | 5 ++--
tools/virsh-completer-volume.c | 5 ++--
tools/virsh-completer.c | 5 ++--
12 files changed, 55 insertions(+), 96 deletions(-)
--
2.26.2
4 years, 2 months
[libvirt PATCH] util: virNetDevTapCreate: initialize fd to -1
by Ján Tomko
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
Fixes: 95089f481e003d971fe0a082018216c58c1b80e5
---
Pushed as trivial.
src/util/virnetdevtap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index ab5959c646..cbce5c71b7 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -322,7 +322,7 @@ int virNetDevTapCreate(char **ifname,
size_t i = 0;
struct ifreq ifr;
int ret = -1;
- int fd = 0;
+ int fd = -1;
virMutexLock(&virNetDevTapCreateMutex);
--
2.26.2
4 years, 2 months
[libvirt PATCH 1/2] esx: generator: add GuestNicInfo object
by Pino Toscano
Add the definition of the GuestNicInfo object, with all the required
objects for it.
Signed-off-by: Pino Toscano <ptoscano(a)redhat.com>
---
scripts/esx_vi_generator.py | 1 +
src/esx/esx_vi_generator.input | 54 ++++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+)
diff --git a/scripts/esx_vi_generator.py b/scripts/esx_vi_generator.py
index e0782e35f3..7929e1e682 100755
--- a/scripts/esx_vi_generator.py
+++ b/scripts/esx_vi_generator.py
@@ -1292,6 +1292,7 @@ additional_object_features = {
"DatastoreHostMount": (Object.FEATURE__DEEP_COPY | Object.FEATURE__LIST |
Object.FEATURE__ANY_TYPE),
"DatastoreInfo": Object.FEATURE__ANY_TYPE | Object.FEATURE__DYNAMIC_CAST,
+ "GuestNicInfo": Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE,
"HostConfigManager": Object.FEATURE__ANY_TYPE,
"HostCpuIdInfo": Object.FEATURE__LIST | Object.FEATURE__ANY_TYPE,
"HostDatastoreBrowserSearchResults": (Object.FEATURE__LIST |
diff --git a/src/esx/esx_vi_generator.input b/src/esx/esx_vi_generator.input
index 22c114e0aa..bd6ac72a18 100644
--- a/src/esx/esx_vi_generator.input
+++ b/src/esx/esx_vi_generator.input
@@ -277,6 +277,18 @@ object FolderFileQuery extends FileQuery
end
+object GuestNicInfo
+ Boolean connected r
+ Int deviceConfigId r
+ NetDnsConfigInfo dnsConfig o
+ String ipAddress ol
+ NetIpConfigInfo ipConfig o
+ String macAddress o
+ NetBIOSConfigInfo netBIOSConfig o
+ String network o
+end
+
+
object HostAutoStartManagerConfig
AutoStartDefaults defaults o
AutoStartPowerInfo powerInfo ol
@@ -770,6 +782,48 @@ object NasDatastoreInfo extends DatastoreInfo
end
+object NetBIOSConfigInfo
+ String mode r
+end
+
+
+object NetDhcpConfigInfo
+ NetDhcpConfigInfoDhcpOptions ipv4 o
+ NetDhcpConfigInfoDhcpOptions ipv6 o
+end
+
+
+object NetDhcpConfigInfoDhcpOptions
+ KeyAnyValue config ol
+ Boolean enable r
+end
+
+
+object NetDnsConfigInfo
+ Boolean dhcp r
+ String domainName r
+ String hostName r
+ String ipAddress ol
+ String searchDomain ol
+end
+
+
+object NetIpConfigInfo
+ Boolean autoConfigurationEnabled o
+ NetDhcpConfigInfo dhcp o
+ NetIpConfigInfoIpAddress ipAddress ol
+end
+
+
+object NetIpConfigInfoIpAddress
+ String ipAddress r
+ DateTime lifetime o
+ String origin o
+ Int prefixLength r
+ String state o
+end
+
+
object ObjectContent
ManagedObjectReference obj r
DynamicProperty propSet ol
--
2.26.2
4 years, 2 months
[libvirt PATCH] esx: implement connectListAllNetworks
by Pino Toscano
Implement the .connectListAllNetworks networks API in the esx network
driver.
Signed-off-by: Pino Toscano <ptoscano(a)redhat.com>
---
src/esx/esx_network_driver.c | 64 ++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/src/esx/esx_network_driver.c b/src/esx/esx_network_driver.c
index 88843aae2f..5d9c1e3c2c 100644
--- a/src/esx/esx_network_driver.c
+++ b/src/esx/esx_network_driver.c
@@ -863,6 +863,69 @@ esxNetworkIsPersistent(virNetworkPtr network G_GNUC_UNUSED)
+#define MATCH(FLAG) (flags & (FLAG))
+static int
+esxConnectListAllNetworks(virConnectPtr conn,
+ virNetworkPtr **nets,
+ unsigned int flags)
+{
+ int ret = -1;
+ esxPrivate *priv = conn->privateData;
+ esxVI_HostVirtualSwitch *hostVirtualSwitchList = NULL;
+ esxVI_HostVirtualSwitch *hostVirtualSwitch = NULL;
+ size_t count = 0;
+ size_t i;
+
+ virCheckFlags(VIR_CONNECT_LIST_NETWORKS_FILTERS_ALL, -1);
+
+ /*
+ * ESX networks are always active, persistent, and
+ * autostarted, so return zero elements in case we are asked
+ * for networks different than that.
+ */
+ if (MATCH(VIR_CONNECT_LIST_NETWORKS_FILTERS_ACTIVE) &&
+ !(MATCH(VIR_CONNECT_LIST_NETWORKS_ACTIVE)))
+ return 0;
+ if (MATCH(VIR_CONNECT_LIST_NETWORKS_FILTERS_PERSISTENT) &&
+ !(MATCH(VIR_CONNECT_LIST_NETWORKS_PERSISTENT)))
+ return 0;
+ if (MATCH(VIR_CONNECT_LIST_NETWORKS_FILTERS_AUTOSTART) &&
+ !(MATCH(VIR_CONNECT_LIST_NETWORKS_AUTOSTART)))
+ return 0;
+
+ if (esxVI_EnsureSession(priv->primary) < 0 ||
+ esxVI_LookupHostVirtualSwitchList(priv->primary,
+ &hostVirtualSwitchList) < 0) {
+ return -1;
+ }
+
+ for (hostVirtualSwitch = hostVirtualSwitchList; hostVirtualSwitch;
+ hostVirtualSwitch = hostVirtualSwitch->_next) {
+ virNetworkPtr net = virtualswitchToNetwork(conn, hostVirtualSwitch);
+
+ if (VIR_APPEND_ELEMENT(*nets, count, net) < 0)
+ goto cleanup;
+ }
+
+ ret = count;
+
+ cleanup:
+ if (ret < 0) {
+ if (*nets) {
+ for (i = 0; i < count; ++i)
+ VIR_FREE((*nets)[i]);
+ VIR_FREE(*nets);
+ }
+ }
+
+ esxVI_HostVirtualSwitch_Free(&hostVirtualSwitchList);
+
+ return ret;
+}
+#undef MATCH
+
+
+
virNetworkDriver esxNetworkDriver = {
.connectNumOfNetworks = esxConnectNumOfNetworks, /* 0.10.0 */
.connectListNetworks = esxConnectListNetworks, /* 0.10.0 */
@@ -877,4 +940,5 @@ virNetworkDriver esxNetworkDriver = {
.networkSetAutostart = esxNetworkSetAutostart, /* 0.10.0 */
.networkIsActive = esxNetworkIsActive, /* 0.10.0 */
.networkIsPersistent = esxNetworkIsPersistent, /* 0.10.0 */
+ .connectListAllNetworks = esxConnectListAllNetworks, /* 6.8.0 */
};
--
2.26.2
4 years, 2 months
[libvirt PATCH v2 0/7] Remove VIR_{ALLOC, ALLOC_N, REALLOC_N}_QUIET macros.
by Tim Wiederhake
V1: https://www.redhat.com/archives/libvir-list/2020-September/msg00633.html
Tim Wiederhake (7):
tests: Fix false positive in testConfRoundTrip.
util: Use glib memory functions in virErrorCopyNew
util: Use glib memory functions in virLastErrorObject
util: Remove VIR_ALLOC_QUIET
tests: Use glib memory function in testConfRoundTrip
util: Use glib memory functions in virJSONValueGetArrayAsBitmap
util: Remove VIR_ALLOC_N_QUIET
src/util/viralloc.h | 29 -----------------------------
src/util/virerror.c | 15 ++++-----------
src/util/virjson.c | 3 +--
tests/virconftest.c | 28 +++++++++-------------------
4 files changed, 14 insertions(+), 61 deletions(-)
--
2.26.2
4 years, 2 months
[libvirt PATCH 0/3] fix a memory leak on qemuProcessReconnect
by Ján Tomko
The first two patches have no functional impact on current code.
Ján Tomko (3):
qemu: rename qemuDomainObjFreeJob -> qemuDomainObjClearJob
qemu: qemuDomainObjClearJob: use g_clear_pointer
qemuProcessReconnect: clear 'oldjob'
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_domainjob.c | 7 +++++--
src/qemu/qemu_domainjob.h | 3 ++-
src/qemu/qemu_process.c | 2 +-
4 files changed, 9 insertions(+), 5 deletions(-)
--
2.26.2
4 years, 2 months
[PATCH v2] cphp: remove deprecated cpu-add command(s)
by Igor Mammedov
theses were deprecated since 4.0, remove both HMP and QMP variants.
Users should use device_add command instead. To get list of
possible CPUs and options, use 'info hotpluggable-cpus' HMP
or query-hotpluggable-cpus QMP command.
Signed-off-by: Igor Mammedov <imammedo(a)redhat.com>
Reviewed-by: Thomas Huth <thuth(a)redhat.com>
Acked-by: Dr. David Alan Gilbert <dgilbert(a)redhat.com>
---
include/hw/boards.h | 1 -
include/hw/i386/pc.h | 1 -
include/monitor/hmp.h | 1 -
docs/system/deprecated.rst | 25 +++++----
hmp-commands.hx | 15 ------
hw/core/machine-hmp-cmds.c | 12 -----
hw/core/machine-qmp-cmds.c | 12 -----
hw/i386/pc.c | 27 ----------
hw/i386/pc_piix.c | 1 -
hw/s390x/s390-virtio-ccw.c | 12 -----
qapi/machine.json | 24 ---------
tests/qtest/cpu-plug-test.c | 100 ++++--------------------------------
tests/qtest/test-hmp.c | 1 -
13 files changed, 21 insertions(+), 211 deletions(-)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 795910d01b..7abd5d889c 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -169,7 +169,6 @@ struct MachineClass {
void (*init)(MachineState *state);
void (*reset)(MachineState *state);
void (*wakeup)(MachineState *state);
- void (*hot_add_cpu)(MachineState *state, const int64_t id, Error **errp);
int (*kvm_type)(MachineState *machine, const char *arg);
void (*smp_parse)(MachineState *ms, QemuOpts *opts);
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 421a77acc2..79b7ab17bc 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -135,7 +135,6 @@ extern int fd_bootchk;
void pc_acpi_smi_interrupt(void *opaque, int irq, int level);
-void pc_hot_add_cpu(MachineState *ms, const int64_t id, Error **errp);
void pc_smp_parse(MachineState *ms, QemuOpts *opts);
void pc_guest_info_init(PCMachineState *pcms);
diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
index c986cfd28b..642e9e91f9 100644
--- a/include/monitor/hmp.h
+++ b/include/monitor/hmp.h
@@ -89,7 +89,6 @@ void hmp_chardev_add(Monitor *mon, const QDict *qdict);
void hmp_chardev_change(Monitor *mon, const QDict *qdict);
void hmp_chardev_remove(Monitor *mon, const QDict *qdict);
void hmp_chardev_send_break(Monitor *mon, const QDict *qdict);
-void hmp_cpu_add(Monitor *mon, const QDict *qdict);
void hmp_object_add(Monitor *mon, const QDict *qdict);
void hmp_object_del(Monitor *mon, const QDict *qdict);
void hmp_info_memdev(Monitor *mon, const QDict *qdict);
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index a158e765c3..c43c53f432 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -284,13 +284,6 @@ The ``query-cpus`` command is replaced by the ``query-cpus-fast`` command.
The ``arch`` output member of the ``query-cpus-fast`` command is
replaced by the ``target`` output member.
-``cpu-add`` (since 4.0)
-'''''''''''''''''''''''
-
-Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
-documentation of ``query-hotpluggable-cpus`` for additional
-details.
-
``query-events`` (since 4.0)
''''''''''''''''''''''''''''
@@ -306,12 +299,6 @@ the 'wait' field, which is only applicable to sockets in server mode
Human Monitor Protocol (HMP) commands
-------------------------------------
-``cpu-add`` (since 4.0)
-'''''''''''''''''''''''
-
-Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
-documentation of ``query-hotpluggable-cpus`` for additional details.
-
``acl_show``, ``acl_reset``, ``acl_policy``, ``acl_add``, ``acl_remove`` (since 4.0.0)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
@@ -521,6 +508,12 @@ QEMU Machine Protocol (QMP) commands
The "autoload" parameter has been ignored since 2.12.0. All bitmaps
are automatically loaded from qcow2 images.
+``cpu-add`` (removed in 5.2)
+''''''''''''''''''''''''''''
+
+Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
+documentation of ``query-hotpluggable-cpus`` for additional details.
+
Human Monitor Protocol (HMP) commands
-------------------------------------
@@ -530,6 +523,12 @@ The ``hub_id`` parameter of ``hostfwd_add`` / ``hostfwd_remove`` (removed in 5.0
The ``[hub_id name]`` parameter tuple of the 'hostfwd_add' and
'hostfwd_remove' HMP commands has been replaced by ``netdev_id``.
+``cpu-add`` (removed in 5.2)
+''''''''''''''''''''''''''''
+
+Use ``device_add`` for hotplugging vCPUs instead of ``cpu-add``. See
+documentation of ``query-hotpluggable-cpus`` for additional details.
+
Guest Emulator ISAs
-------------------
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 60f395c276..d1e3e0e1c6 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1761,21 +1761,6 @@ SRST
Executes a qemu-io command on the given block device.
ERST
- {
- .name = "cpu-add",
- .args_type = "id:i",
- .params = "id",
- .help = "add cpu (deprecated, use device_add instead)",
- .cmd = hmp_cpu_add,
- },
-
-SRST
-``cpu-add`` *id*
- Add CPU with id *id*. This command is deprecated, please
- +use ``device_add`` instead. For details, refer to
- 'docs/cpu-hotplug.rst'.
-ERST
-
{
.name = "qom-list",
.args_type = "path:s?",
diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c
index 39999c47c5..f4092b98cc 100644
--- a/hw/core/machine-hmp-cmds.c
+++ b/hw/core/machine-hmp-cmds.c
@@ -46,18 +46,6 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict)
qapi_free_CpuInfoFastList(cpu_list);
}
-void hmp_cpu_add(Monitor *mon, const QDict *qdict)
-{
- int cpuid;
- Error *err = NULL;
-
- error_report("cpu_add is deprecated, please use device_add instead");
-
- cpuid = qdict_get_int(qdict, "id");
- qmp_cpu_add(cpuid, &err);
- hmp_handle_error(mon, err);
-}
-
void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict)
{
Error *err = NULL;
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 21551221ad..5362c80a18 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -284,18 +284,6 @@ HotpluggableCPUList *qmp_query_hotpluggable_cpus(Error **errp)
return machine_query_hotpluggable_cpus(ms);
}
-void qmp_cpu_add(int64_t id, Error **errp)
-{
- MachineClass *mc;
-
- mc = MACHINE_GET_CLASS(current_machine);
- if (mc->hot_add_cpu) {
- mc->hot_add_cpu(current_machine, id, errp);
- } else {
- error_setg(errp, "Not supported");
- }
-}
-
void qmp_set_numa_node(NumaOptions *cmd, Error **errp)
{
if (!runstate_check(RUN_STATE_PRECONFIG)) {
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index d11daacc23..d071da787b 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -777,32 +777,6 @@ void pc_smp_parse(MachineState *ms, QemuOpts *opts)
}
}
-void pc_hot_add_cpu(MachineState *ms, const int64_t id, Error **errp)
-{
- X86MachineState *x86ms = X86_MACHINE(ms);
- int64_t apic_id = x86_cpu_apic_id_from_index(x86ms, id);
- Error *local_err = NULL;
-
- if (id < 0) {
- error_setg(errp, "Invalid CPU id: %" PRIi64, id);
- return;
- }
-
- if (apic_id >= ACPI_CPU_HOTPLUG_ID_LIMIT) {
- error_setg(errp, "Unable to add CPU: %" PRIi64
- ", resulting APIC ID (%" PRIi64 ") is too large",
- id, apic_id);
- return;
- }
-
-
- x86_cpu_new(X86_MACHINE(ms), apic_id, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- return;
- }
-}
-
static void rtc_set_cpus_count(ISADevice *rtc, uint16_t cpus_count)
{
if (cpus_count > 0xff) {
@@ -1966,7 +1940,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
mc->auto_enable_numa_with_memdev = true;
mc->has_hotpluggable_cpus = true;
mc->default_boot_order = "cad";
- mc->hot_add_cpu = pc_hot_add_cpu;
mc->smp_parse = pc_smp_parse;
mc->block_default_type = IF_IDE;
mc->max_cpus = 255;
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 33fa035fb7..8ce7dda464 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -752,7 +752,6 @@ static void pc_i440fx_1_4_machine_options(MachineClass *m)
{
pc_i440fx_1_5_machine_options(m);
m->hw_version = "1.4.0";
- m->hot_add_cpu = NULL;
compat_props_add(m->compat_props, pc_compat_1_4, pc_compat_1_4_len);
}
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 3106bbea33..28266a3a35 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -553,17 +553,6 @@ static HotplugHandler *s390_get_hotplug_handler(MachineState *machine,
return NULL;
}
-static void s390_hot_add_cpu(MachineState *machine,
- const int64_t id, Error **errp)
-{
- ObjectClass *oc;
-
- g_assert(machine->possible_cpus->cpus[0].cpu);
- oc = OBJECT_CLASS(CPU_GET_CLASS(machine->possible_cpus->cpus[0].cpu));
-
- s390x_new_cpu(object_class_get_name(oc), id, errp);
-}
-
static void s390_nmi(NMIState *n, int cpu_index, Error **errp)
{
CPUState *cs = qemu_get_cpu(cpu_index);
@@ -604,7 +593,6 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
s390mc->hpage_1m_allowed = true;
mc->init = ccw_init;
mc->reset = s390_machine_reset;
- mc->hot_add_cpu = s390_hot_add_cpu;
mc->block_default_type = IF_VIRTIO;
mc->no_cdrom = 1;
mc->no_floppy = 1;
diff --git a/qapi/machine.json b/qapi/machine.json
index 0ac1880e4a..d8ed096e9a 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -307,30 +307,6 @@
##
{ 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
-##
-# @cpu-add:
-#
-# Adds CPU with specified ID.
-#
-# @id: ID of CPU to be created, valid values [0..max_cpus)
-#
-# Features:
-# @deprecated: This command is deprecated. Use `device_add` instead.
-# See the `query-hotpluggable-cpus` command for details.
-#
-# Returns: Nothing on success
-#
-# Since: 1.5
-#
-# Example:
-#
-# -> { "execute": "cpu-add", "arguments": { "id": 2 } }
-# <- { "return": {} }
-#
-##
-{ 'command': 'cpu-add', 'data': {'id': 'int'},
- 'features': [ 'deprecated' ] }
-
##
# @MachineInfo:
#
diff --git a/tests/qtest/cpu-plug-test.c b/tests/qtest/cpu-plug-test.c
index e8ffbbce4b..a1c689414b 100644
--- a/tests/qtest/cpu-plug-test.c
+++ b/tests/qtest/cpu-plug-test.c
@@ -25,54 +25,6 @@ struct PlugTestData {
};
typedef struct PlugTestData PlugTestData;
-static void test_plug_with_cpu_add(gconstpointer data)
-{
- const PlugTestData *s = data;
- char *args;
- QDict *response;
- unsigned int i;
-
- args = g_strdup_printf("-machine %s -cpu %s "
- "-smp 1,sockets=%u,cores=%u,threads=%u,maxcpus=%u",
- s->machine, s->cpu_model,
- s->sockets, s->cores, s->threads, s->maxcpus);
- qtest_start(args);
-
- for (i = 1; i < s->maxcpus; i++) {
- response = qmp("{ 'execute': 'cpu-add',"
- " 'arguments': { 'id': %d } }", i);
- g_assert(response);
- g_assert(!qdict_haskey(response, "error"));
- qobject_unref(response);
- }
-
- qtest_end();
- g_free(args);
-}
-
-static void test_plug_without_cpu_add(gconstpointer data)
-{
- const PlugTestData *s = data;
- char *args;
- QDict *response;
-
- args = g_strdup_printf("-machine %s -cpu %s "
- "-smp 1,sockets=%u,cores=%u,threads=%u,maxcpus=%u",
- s->machine, s->cpu_model,
- s->sockets, s->cores, s->threads, s->maxcpus);
- qtest_start(args);
-
- response = qmp("{ 'execute': 'cpu-add',"
- " 'arguments': { 'id': %d } }",
- s->sockets * s->cores * s->threads);
- g_assert(response);
- g_assert(qdict_haskey(response, "error"));
- qobject_unref(response);
-
- qtest_end();
- g_free(args);
-}
-
static void test_plug_with_device_add(gconstpointer data)
{
const PlugTestData *td = data;
@@ -144,36 +96,13 @@ static void add_pc_test_case(const char *mname)
data->cores = 3;
data->threads = 2;
data->maxcpus = data->sockets * data->cores * data->threads;
- if (g_str_has_suffix(mname, "-1.4") ||
- (strcmp(mname, "pc-1.3") == 0) ||
- (strcmp(mname, "pc-1.2") == 0) ||
- (strcmp(mname, "pc-1.1") == 0) ||
- (strcmp(mname, "pc-1.0") == 0)) {
- path = g_strdup_printf("cpu-plug/%s/init/%ux%ux%u&maxcpus=%u",
- mname, data->sockets, data->cores,
- data->threads, data->maxcpus);
- qtest_add_data_func_full(path, data, test_plug_without_cpu_add,
- test_data_free);
- g_free(path);
- } else {
- PlugTestData *data2 = g_memdup(data, sizeof(PlugTestData));
-
- data2->machine = g_strdup(data->machine);
- data2->device_model = g_strdup(data->device_model);
- path = g_strdup_printf("cpu-plug/%s/cpu-add/%ux%ux%u&maxcpus=%u",
- mname, data->sockets, data->cores,
- data->threads, data->maxcpus);
- qtest_add_data_func_full(path, data, test_plug_with_cpu_add,
- test_data_free);
- g_free(path);
- path = g_strdup_printf("cpu-plug/%s/device-add/%ux%ux%u&maxcpus=%u",
- mname, data2->sockets, data2->cores,
- data2->threads, data2->maxcpus);
- qtest_add_data_func_full(path, data2, test_plug_with_device_add,
- test_data_free);
- g_free(path);
- }
+ path = g_strdup_printf("cpu-plug/%s/device-add/%ux%ux%u&maxcpus=%u",
+ mname, data->sockets, data->cores,
+ data->threads, data->maxcpus);
+ qtest_add_data_func_full(path, data, test_plug_with_device_add,
+ test_data_free);
+ g_free(path);
}
static void add_pseries_test_case(const char *mname)
@@ -205,7 +134,7 @@ static void add_pseries_test_case(const char *mname)
static void add_s390x_test_case(const char *mname)
{
char *path;
- PlugTestData *data, *data2;
+ PlugTestData *data;
if (!g_str_has_prefix(mname, "s390-ccw-virtio-")) {
return;
@@ -220,21 +149,10 @@ static void add_s390x_test_case(const char *mname)
data->threads = 1;
data->maxcpus = data->sockets * data->cores * data->threads;
- data2 = g_memdup(data, sizeof(PlugTestData));
- data2->machine = g_strdup(data->machine);
- data2->device_model = g_strdup(data->device_model);
-
- path = g_strdup_printf("cpu-plug/%s/cpu-add/%ux%ux%u&maxcpus=%u",
+ path = g_strdup_printf("cpu-plug/%s/device-add/%ux%ux%u&maxcpus=%u",
mname, data->sockets, data->cores,
data->threads, data->maxcpus);
- qtest_add_data_func_full(path, data, test_plug_with_cpu_add,
- test_data_free);
- g_free(path);
-
- path = g_strdup_printf("cpu-plug/%s/device-add/%ux%ux%u&maxcpus=%u",
- mname, data2->sockets, data2->cores,
- data2->threads, data2->maxcpus);
- qtest_add_data_func_full(path, data2, test_plug_with_device_add,
+ qtest_add_data_func_full(path, data, test_plug_with_device_add,
test_data_free);
g_free(path);
}
diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c
index aea1384bac..94a8023173 100644
--- a/tests/qtest/test-hmp.c
+++ b/tests/qtest/test-hmp.c
@@ -27,7 +27,6 @@ static const char *hmp_cmds[] = {
"chardev-change testchardev1 ringbuf",
"chardev-remove testchardev1",
"commit all",
- "cpu-add 1",
"cpu 0",
"device_add ?",
"device_add usb-mouse,id=mouse1",
--
2.27.0
4 years, 2 months
Issues with building libvirt v6.7.0 on RHEL8.3
by Eli Cohen
Hello all,
I hope this is being posted in the right mailing list.
I am trying to build libvirt v6.7.0 on RHEL8.3 x86_64 server in order to
later apply patches for VDPA support posted recently by Jonathon Jongsma
<jjongsma(a)redhat.com>.
I am following the instrutions in https://libvirt.org/contribute.html
and running from the root directory:
meson build --prefix=/usr
I fail on the following error:
meson.build:921:2: ERROR: Program 'rpcgen portable-rpcgen' not found
I can't find any reference how to overcome this obstacle.
Thanks for any help,
Eli
4 years, 2 months