RFE - Add support for QEMU's 9pfs's fmode/dmode options
by Brian Turek
Hello All,
I recently ran into problems with the default very restrictive permissions
for files that are created via 9pfs host/guest shares (600 for files, 700
for directories). QEMU added two new-ish flags, fmode and dmode, to its
9pfs implementation so that users are able to control these exact
permissions.
Would it be possible to expose these two flags via the domain XML? I made
an issue on the libvirt Gitlab (
https://gitlab.com/libvirt/libvirt/-/issues/80) but it appears mailing list
posts may be preferred.
Thank you
4 years, 6 months
Renaming the 'master' branch
by Ján Tomko
According to latest fashion trends, it is possible
to rename the default branch.
Can we rename it to 'main'?
It's one less syllable and two letters shorter.
Jano
4 years, 6 months
[PATCH] virDomainNumaFillCPUsInNode: Skip over NUMA nodes without vCPUs
by Michal Privoznik
After v6.5.0-rc1~148 we started to rectify vCPU to guest NUMA
assignment - if there is a vCPU not assigned to any guest NUMA
node it is automatically assigned to node #0.
A month later I've made it possible to define guest NUMA nodes
without vCPUs (v6.6.0-rc1~250) - this is needed because of HMAT.
As a part of that I fixed all callers of
virDomainNumaGetNodeCpumask() (which returns a bitmap of vCPUs for
given node) to handle case when NULL is returned (i.e. no vCPUs
assigned to given node). But of course my patch was written
before aforementioned vCPU rectify patch but merged afterwards
and hence I missed the virDomainNumaFillCPUsInNode() caller.
And because we are dealing with a NULL pointer, of course this
leads to a crash. Just try to define a domain with at least two
NUMA nodes and no vCPU assignment to any of the nodes.
Fixes: a26f61ee0cffa421b87ef568002b684dd8025432
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1880289
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/numa_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
index bfa312215c..cc6c77f105 100644
--- a/src/conf/numa_conf.c
+++ b/src/conf/numa_conf.c
@@ -1816,7 +1816,7 @@ virDomainNumaFillCPUsInNode(virDomainNumaPtr numa,
for (i = 0; i < numa->nmem_nodes; i++) {
virBitmapPtr nodeCpus = virDomainNumaGetNodeCpumask(numa, i);
- if (i == node)
+ if (i == node || !nodeCpus)
continue;
virBitmapSubtract(maxCPUsBitmap, nodeCpus);
--
2.26.2
4 years, 6 months
Re: [libvirt PATCH] cpu_map: Add EPYC-Rome model
by Markus Schade
Okay, that did not go as expected. Anyway
This patch add the qemu EPYC-Rome model and includes cpuid data from an
EPYC 7502 system as well as updated cpuid information from a Ryzen 9
3900 system.
Since the EPYC 7502 and the Ryzen 9 are pretty much identical, the
latter could be dropped as there is no corresponding qemu model.
Markus
4 years, 6 months
[libvirt PATCH 0/7] use g_new0 more: volume two (glib chronicles)
by Ján Tomko
Ján Tomko (7):
bhyve: use g_new0 instead of VIR_ALLOC*
esx: use g_new0 instead of VIR_ALLOC*
hyperv: use g_new0 instead of VIR_ALLOC*
interface: use g_new0 instead of VIR_ALLOC*
src: libvirt-stream: use g_new0 instead of VIR_ALLOC*
storage: scsi: invert logic in createVport
storage: use g_new0 instead of VIR_ALLOC*
src/bhyve/bhyve_capabilities.c | 3 +-
src/bhyve/bhyve_domain.c | 9 ++----
src/bhyve/bhyve_driver.c | 3 +-
src/bhyve/bhyve_parse_command.c | 7 ++---
src/esx/esx_driver.c | 14 ++++-----
src/esx/esx_network_driver.c | 17 ++++-------
src/esx/esx_storage_backend_iscsi.c | 3 +-
src/esx/esx_storage_backend_vmfs.c | 8 ++---
src/esx/esx_stream.c | 6 ++--
src/esx/esx_util.c | 3 +-
src/esx/esx_vi.c | 12 +++-----
src/esx/esx_vi_types.c | 3 +-
src/hyperv/hyperv_driver.c | 13 ++++-----
src/hyperv/hyperv_util.c | 3 +-
src/hyperv/hyperv_wmi.c | 13 ++-------
src/interface/interface_backend_netcf.c | 16 ++++------
src/interface/interface_backend_udev.c | 22 +++++---------
src/libvirt-stream.c | 12 +++-----
src/storage/storage_backend_disk.c | 6 ++--
src/storage/storage_backend_fs.c | 8 ++---
src/storage/storage_backend_gluster.c | 12 +++-----
src/storage/storage_backend_iscsi.c | 8 ++---
src/storage/storage_backend_iscsi_direct.c | 13 ++++-----
src/storage/storage_backend_logical.c | 6 ++--
src/storage/storage_backend_mpath.c | 3 +-
src/storage/storage_backend_rbd.c | 29 +++++++-----------
src/storage/storage_backend_scsi.c | 17 +++++------
src/storage/storage_backend_sheepdog.c | 3 +-
src/storage/storage_backend_zfs.c | 3 +-
src/storage/storage_driver.c | 14 +++------
src/storage/storage_file_fs.c | 3 +-
src/storage/storage_file_gluster.c | 6 ++--
src/storage/storage_util.c | 34 ++++++++--------------
33 files changed, 117 insertions(+), 215 deletions(-)
--
2.26.2
4 years, 6 months
[libvirt PATCH 0/2] fix compat with other rst2html5 tool impl
by Daniel P. Berrangé
Daniel P. Berrangé (2):
ci: introduce pygments package to install
docs: specify "sh" as the language for code-block directives
.gitlab-ci.yml | 2 +-
ci/cirrus/build.yml | 6 +-
ci/cirrus/libvirt-freebsd-11.vars | 5 +-
ci/cirrus/libvirt-freebsd-12.vars | 5 +-
ci/cirrus/libvirt-macos-1015.vars | 6 +-
ci/cirrus/refresh | 2 +-
ci/containers/libvirt-centos-7.Dockerfile | 1 +
ci/containers/libvirt-centos-8.Dockerfile | 1 +
.../libvirt-centos-stream.Dockerfile | 1 +
...libvirt-debian-10-cross-aarch64.Dockerfile | 1 +
.../libvirt-debian-10-cross-armv6l.Dockerfile | 1 +
.../libvirt-debian-10-cross-armv7l.Dockerfile | 1 +
.../libvirt-debian-10-cross-i686.Dockerfile | 1 +
.../libvirt-debian-10-cross-mips.Dockerfile | 1 +
...ibvirt-debian-10-cross-mips64el.Dockerfile | 1 +
.../libvirt-debian-10-cross-mipsel.Dockerfile | 1 +
...libvirt-debian-10-cross-ppc64le.Dockerfile | 1 +
.../libvirt-debian-10-cross-s390x.Dockerfile | 1 +
ci/containers/libvirt-debian-10.Dockerfile | 1 +
...ibvirt-debian-sid-cross-aarch64.Dockerfile | 1 +
...libvirt-debian-sid-cross-armv6l.Dockerfile | 1 +
...libvirt-debian-sid-cross-armv7l.Dockerfile | 1 +
.../libvirt-debian-sid-cross-i686.Dockerfile | 1 +
...bvirt-debian-sid-cross-mips64el.Dockerfile | 1 +
...libvirt-debian-sid-cross-mipsel.Dockerfile | 1 +
...ibvirt-debian-sid-cross-ppc64le.Dockerfile | 1 +
.../libvirt-debian-sid-cross-s390x.Dockerfile | 1 +
ci/containers/libvirt-debian-sid.Dockerfile | 1 +
ci/containers/libvirt-fedora-31.Dockerfile | 1 +
ci/containers/libvirt-fedora-32.Dockerfile | 1 +
...rt-fedora-rawhide-cross-mingw32.Dockerfile | 1 +
...rt-fedora-rawhide-cross-mingw64.Dockerfile | 1 +
.../libvirt-fedora-rawhide.Dockerfile | 1 +
ci/containers/libvirt-opensuse-151.Dockerfile | 1 +
ci/containers/libvirt-ubuntu-1804.Dockerfile | 1 +
ci/containers/libvirt-ubuntu-2004.Dockerfile | 1 +
docs/manpages/libvirtd.rst | 4 +-
docs/manpages/virsh.rst | 582 +++++++++---------
docs/manpages/virt-admin.rst | 52 +-
docs/manpages/virtlockd.rst | 4 +-
docs/manpages/virtlogd.rst | 4 +-
41 files changed, 366 insertions(+), 336 deletions(-)
--
2.26.2
4 years, 6 months
[PATCH] docs: bhyve: document sound device and VNC bits
by Roman Bogorodskiy
* Document sound device support,
* Document VNC password configuration and framebuffer resolution.
Signed-off-by: Roman Bogorodskiy <bogorodskiy(a)gmail.com>
---
docs/drvbhyve.html.in | 47 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/docs/drvbhyve.html.in b/docs/drvbhyve.html.in
index ca511eeccd..cffb63f1ad 100644
--- a/docs/drvbhyve.html.in
+++ b/docs/drvbhyve.html.in
@@ -389,6 +389,30 @@ it with the <code>port</code> attribute):</p>
<graphics type='vnc' autoport='yes'>
</pre>
+<p><span class="since">Since 6.8.0</span>, it's possible to set framebuffer resolution
+using the <code>resolution</code> sub-element:</p>
+
+<pre>
+ <video>
+ <model type='gop' heads='1' primary='yes'>
+ <resolution x='800' y='600'/>
+ </model>
+ </video>
+</pre>
+
+<p><span class="since">Since 6.8.0</span>, VNC server can be configured to use
+password based authentication:</p>
+
+<pre>
+ <graphics type='vnc' port='5904' passwd='foobar'>
+ <listen type='address' address='127.0.0.1'/>
+ </graphics>
+</pre>
+
+<p>Note: VNC password authentication is known to be cryptographically weak.
+Additionally, the password is passed as a command line argument in clear text.
+Make sure you understand the risks associated with this feature before using it.</p>
+
<h3><a id="clockconfig">Clock configuration</a></h3>
<p>Originally bhyve supported only localtime for RTC. Support for UTC time was introduced in
@@ -432,6 +456,29 @@ supports Intel e1000 network adapter emulation. It's supported in libvirt
...
</pre>
+<h3><a id="sound">Sound device</a></h3>
+
+<p>As of <a href="https://svnweb.freebsd.org/changeset/base/349355">r349355</a> bhyve
+supports sound device emulation. It's supported in libvirt
+<span class="since">since 6.7.0</span>.</p>
+
+<pre>
+...
+ <sound model='ich7'>
+ <audio id='1'/>
+ </sound>
+ <audio id='1' type='oss'>
+ <input dev='/dev/dsp0'/>
+ <output dev='/dev/dsp0'/>
+ </audio>
+...
+</pre>
+
+<p>Here, the <code>sound</code> element specifies the sound device as it's exposed
+to the guest, with <code>ich7</code> being the only supported model now,
+and the <code>audio</code> element specifies how the guest device is mapped
+to the host sound device.</p>
+
<h3><a id="wired">Wiring guest memory</a></h3>
<p><span class="since">Since 4.4.0</span>, it's possible to specify that guest memory should
--
2.27.0
4 years, 6 months
Entering freeze for libvirt-6.8.0
by Jiri Denemark
I have just tagged v6.8.0-rc1 in the repository and pushed signed
tarballs and source RPMs to https://libvirt.org/sources/
Please give the release candidate some testing and in case you find a
serious issue which should have a fix in the upcoming release, feel
free to reply to this thread to make sure the issue is more visible.
If you have not done so yet, please update NEWS.rst to document any
significant change you made since the last release.
Thanks,
Jirka
4 years, 6 months
[PULL v4 09/48] cphp: remove deprecated cpu-add command(s)
by Michael S. Tsirkin
From: Igor Mammedov <imammedo(a)redhat.com>
These 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>
Reviewed-by: Michal Privoznik <mprivozn(a)redhat.com>
Acked-by: Cornelia Huck <cohuck(a)redhat.com>
Message-Id: <20200915120403.1074579-1-imammedo(a)redhat.com>
Reviewed-by: Michael S. Tsirkin <mst(a)redhat.com>
Signed-off-by: Michael S. Tsirkin <mst(a)redhat.com>
---
qapi/machine.json | 24 ---------
include/hw/boards.h | 1 -
include/hw/i386/pc.h | 1 -
include/monitor/hmp.h | 1 -
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 -----
tests/qtest/cpu-plug-test.c | 100 ++++--------------------------------
tests/qtest/test-hmp.c | 1 -
docs/system/deprecated.rst | 25 +++++----
hmp-commands.hx | 15 ------
13 files changed, 21 insertions(+), 211 deletions(-)
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/include/hw/boards.h b/include/hw/boards.h
index 56aa1ca335..482d2833f6 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -168,7 +168,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 b2da2c8d2b..c71b02cafd 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -132,7 +132,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/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 1e2ab5ebe7..50e8317342 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -769,32 +769,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 pc_machine_done(Notifier *notifier, void *data)
{
@@ -1691,7 +1665,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 6f3e78bb60..2d8413a0ce 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/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",
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 17aa74531c..5326141cee 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -272,13 +272,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)
''''''''''''''''''''''''''''
@@ -294,12 +287,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)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
@@ -517,6 +504,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
-------------------------------------
@@ -526,6 +519,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 27c4bbe0f2..1088d64503 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?",
--
MST
4 years, 6 months
handling Hyper-V automatic startup values
by Matt Coleman
Hello,
I’m implementing some new functionality in the Hyper-V driver and could use some input on how I should handle automatic startup values.
Microsoft’s Msvm_VirtualSystemSettingData class stores this setting in a property named AutomaticStartupAction:
https://docs.microsoft.com/en-us/windows/win32/hyperv_v2/msvm-virtualsyst...
This property has several possible values with different meanings:
* 2 means “None.”, which represents that the VM will not automatically start at boot. This corresponds to libvirt’s domainGetAutostart outputting boolean false.
* 3 means “Restart if previously active.” This will start the machine at boot if it was running when the host was shut down or unexpectedly powered off. It appears libvirt does not have a way to represent this.
* 4 means “Always start.” This corresponds to libvirt’s domainGetAutostart outputting boolean true.
* 5 through 32768 are reserved.
I’m unsure how to handle the value 3, since libvirt treats this setting as a boolean...
The domainGetAutostart function places the value in an int:
* https://gitlab.com/libvirt/libvirt/-/blob/master/src/driver-hypervisor.h#...
* https://gitlab.com/libvirt/libvirt/-/blob/master/src/driver-hypervisor.h#...
However, virDomainGetAutostart’s docblock says that it will be treated as a boolean:
https://gitlab.com/libvirt/libvirt/-/blob/master/src/libvirt-domain.c#L66...
Its usage in `virsh dominfo` confirms that:
https://gitlab.com/libvirt/libvirt/-/blob/master/tools/virsh-domain-monit...
I haven’t investigated how other languages' bindings treat the field.
Currently, my code treats anything over 2 as autostart being enabled (although, perhaps I should ignore 5+). I feel like that pretty closely represents the VM’s configuration, since it will autostart in certain cases and it definitely isn’t configured to never autostart.
For 3 (“Restart if previously active.”), it could be argued that libvirt should only say that autostart is enabled when the VM is running. This would more closely represent what the VM’s runtime behavior will be, since `virsh list —autostart` would show you which VMs would boot if the hypervisor rebooted at that point in time. However, it could be considered confusing because the VM’s configuration would appear to change depending on whether or not it was running.
Ultimately, it seems like libvirt’s concept of autostart functionality needs to be extended. Along those lines, it was pointed out on IRC that libvirt lacks the ability to represent hypervisors’ host shutdown activities:
> danpb: we should introduce a <on_hoststop>..</on_hoststop> lifecycle action in the XML to express what actions to take on host shutdown and one of those actions can be “stop-and-restart-on-next-boot”
Hyper-V has a separate setting, AutomaticShutdownAction, which governs the actions taken when the host stops:
* 2 means “Turn off.” This abruptly powers off the VM.
* 3 means “Save state.” This saves the running VM’s state to disk.
* 4 means “Shutdown.” The performs a clean shutdown of the VM.
* 5 through 32768 are reserved.
It seems to me that the two settings complement each other but cover different functionality. I feel like 3 (“Restart if previously active.”) is more closely related to startup activities than the host stopping.
Since it seems like more pervasive changes are needed, I’d prefer to commit something “good enough” for the Hyper-V driver and then refine it along with the rest of the drivers.
Should I make domainGetAutostart only output true for Hyper-V VMs configured with AutomaticStartupAction=3 when they are running? Or, should I leave it as I currently have it (2 = autostart is disabled; 3+ = autostart is enabled)?
Thanks for your time and input, and apologies for how long this got.
Matt
4 years, 6 months