3de3d698 | 21-May-2015 |
Wolfgang Bumiller <w.bumiller@proxmox.com> |
util/qemu-sockets: improve ai_flag hints for ipv6 hosts
*) Do not use AI_ADDRCONFIG on listening sockets, because this flag makes it impossible to explicitly listen on '127.0.0.1' if no global ipv4
util/qemu-sockets: improve ai_flag hints for ipv6 hosts
*) Do not use AI_ADDRCONFIG on listening sockets, because this flag makes it impossible to explicitly listen on '127.0.0.1' if no global ipv4 address is configured additionally, making this a very uncomfortable option. *) Add AI_V4MAPPED hint for connecting sockets.
If your system is globally only connected via ipv6 you often still want to be able to use '127.0.0.1' and 'localhost' (even if localhost doesn't also have an ipv6 entry). For example, PVE - unless explicitly asking for insecure mode - uses ipv4 loopback addresses with QEMU for live migrations tunneled over SSH. These fail to start because AI_ADDRCONFIG makes getaddrinfo refuse to work with '127.0.0.1'.
As for the AI_V4MAPPED flag: glibc uses it by default, and providing non-0 flags removes it. I think it makes sense to use it.
I also want to point out that glibc explicitly sidesteps POSIX standards when passing 0 as hints by then assuming both AI_V4MAPPED and AI_ADDRCONFIG (the latter being a rather weird choice IMO), while according to POSIX.1-2001 it should be assumed 0. (glibc considers its choice an improvement.) Since either AI_CANONNAME or AI_PASSIVE are passed in our cases, glibc's default flags in turn are disabled again unless explicitly added, which I do with this patch.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
show more ...
|
485febc6 | 13-Mar-2015 |
Markus Armbruster <armbru@redhat.com> |
qmp: Wean off qerror_report()
The traditional QMP command handler interface
int qmp_FOO(Monitor *mon, const QDict *params, QObject **ret_data);
doesn't provide for returning an Error object.
qmp: Wean off qerror_report()
The traditional QMP command handler interface
int qmp_FOO(Monitor *mon, const QDict *params, QObject **ret_data);
doesn't provide for returning an Error object. Instead, the handler is expected to stash it in the monitor with qerror_report().
When we rebased QMP on top of QAPI, we didn't change this interface. Instead, commit 776574d introduced "middle mode" as a temporary aid for converting existing QMP commands to QAPI one by one. More than three years later, we're still using it.
Middle mode has two effects:
* Instead of the native input marshallers
static void qmp_marshal_input_FOO(QDict *, QObject **, Error **)
it generates input marshallers conforming to the traditional QMP command handler interface.
* It suppresses generation of code to register them with qmp_register_command()
This permits giving them internal linkage.
As long as we need qmp-commands.hx, we can't use the registry behind qmp_register_command(), so the latter has to stay for now.
The former has to go to get rid of qerror_report(). Changing all QMP commands to fit the QAPI mold in one go was impractical back when we started, but by now there are just a few stragglers left: do_qmp_capabilities(), qmp_qom_set(), qmp_qom_get(), qmp_object_add(), qmp_netdev_add(), do_device_add().
Switch middle mode to generate native input marshallers, and adapt the stragglers. Simplifies both the monitor code and the stragglers.
Rename do_qmp_capabilities() to qmp_capabilities(), and do_device_add() to qmp_device_add, because that's how QMP command handlers are named today.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
show more ...
|
70b94331 | 13-Feb-2015 |
Markus Armbruster <armbru@redhat.com> |
QemuOpts: Wean off qerror_report_err()
qerror_report_err() is a transitional interface to help with converting existing monitor commands to QMP. It should not be used elsewhere.
The only remaining
QemuOpts: Wean off qerror_report_err()
qerror_report_err() is a transitional interface to help with converting existing monitor commands to QMP. It should not be used elsewhere.
The only remaining user in qemu-option.c is qemu_opts_parse(). Is it used in QMP context? If not, we can simply replace qerror_report_err() by error_report_err().
The uses in qemu-img.c, qemu-io.c, qemu-nbd.c and under tests/ are clearly not in QMP context.
The uses in vl.c aren't either, because the only QMP command handlers there are qmp_query_status() and qmp_query_machines(), and they don't call it.
Remaining uses:
* drive_def(): Command line -drive and such, HMP drive_add and pci_add
* hmp_chardev_add(): HMP chardev-add
* monitor_parse_command(): HMP core
* tmp_config_parse(): Command line -tpmdev
* net_host_device_add(): HMP host_net_add
* net_client_parse(): Command line -net and -netdev
* qemu_global_option(): Command line -global
* vnc_parse_func(): Command line -display, -vnc, default display, HMP change, QMP change. Bummer.
* qemu_pci_hot_add_nic(): HMP pci_add
* usb_net_init(): Command line -usbdevice, HMP usb_add
Propagate errors through qemu_opts_parse(). Create a convenience function qemu_opts_parse_noisily() that passes errors to error_report_err(). Switch all non-QMP users outside tests to it.
That leaves vnc_parse_func(). Propagate errors through it. Since I'm touching it anyway, rename it to vnc_parse().
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
show more ...
|
71df1d83 | 12-Mar-2015 |
Markus Armbruster <armbru@redhat.com> |
QemuOpts: Convert qemu_opt_foreach() to Error
Retain the function value for now, to permit selective conversion of its callers.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eri
QemuOpts: Convert qemu_opt_foreach() to Error
Retain the function value for now, to permit selective conversion of its callers.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
show more ...
|
1640b200 | 12-Mar-2015 |
Markus Armbruster <armbru@redhat.com> |
QemuOpts: Drop qemu_opt_foreach() parameter abort_on_failure
When the argument is non-zero, qemu_opt_foreach() stops on callback returning non-zero, and returns that value.
When the argument is zer
QemuOpts: Drop qemu_opt_foreach() parameter abort_on_failure
When the argument is non-zero, qemu_opt_foreach() stops on callback returning non-zero, and returns that value.
When the argument is zero, it doesn't stop, and returns the callback's value from the last iteration.
The two callers that pass zero could just as well pass one:
* qemu_spice_init()'s callback add_channel() either returns zero or exit()s.
* config_write_opts()'s callback config_write_opt() always returns zero.
Drop the parameter, and always stop.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
show more ...
|
36546e5b | 02-Dec-2014 |
Stefan Hajnoczi <stefanha@redhat.com> |
bitmap: add atomic test and clear
The new bitmap_test_and_clear_atomic() function clears a range and returns whether or not the bits were set.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> M
bitmap: add atomic test and clear
The new bitmap_test_and_clear_atomic() function clears a range and returns whether or not the bits were set.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <1417519399-3166-3-git-send-email-stefanha@redhat.com> [Test before xchg; then a full barrier is needed at the end just like in the previous patch. The barrier can be avoided if we did at least one xchg. - Paolo] Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
6a11d518 | 12-May-2015 |
Daniel P. Berrange <berrange@redhat.com> |
util: allow \n to terminate password input
The qemu_read_password() method looks for \r to terminate the reading of the a password. This is what will be seen when reading the password from a TTY. Wh
util: allow \n to terminate password input
The qemu_read_password() method looks for \r to terminate the reading of the a password. This is what will be seen when reading the password from a TTY. When scripting though, it is useful to be able to send the password via a pipe, in which case we must look for \n to terminate password input.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|