mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
hw/usb: simplified usb_enabled
The argument is not longer used and the implementation uses now QOM instead of QemuOpts. Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
759bf45d81
commit
09f28e5b51
12 changed files with 17 additions and 18 deletions
11
vl.c
11
vl.c
|
@ -1002,10 +1002,9 @@ bool defaults_enabled(void)
|
|||
return has_defaults;
|
||||
}
|
||||
|
||||
bool usb_enabled(bool default_usb)
|
||||
bool usb_enabled(void)
|
||||
{
|
||||
return qemu_opt_get_bool(qemu_get_machine_opts(), "usb",
|
||||
default_usb);
|
||||
return machine_usb(current_machine);
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
|
@ -1229,7 +1228,7 @@ static int usb_device_add(const char *devname)
|
|||
const char *p;
|
||||
#endif
|
||||
|
||||
if (!usb_enabled(false)) {
|
||||
if (!usb_enabled()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1261,7 +1260,7 @@ static int usb_device_del(const char *devname)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (!usb_enabled(false)) {
|
||||
if (!usb_enabled()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -4230,7 +4229,7 @@ int main(int argc, char **argv, char **envp)
|
|||
set_numa_modes();
|
||||
|
||||
/* init USB devices */
|
||||
if (usb_enabled(false)) {
|
||||
if (usb_enabled()) {
|
||||
if (foreach_device_config(DEV_USB, usb_parse) < 0)
|
||||
exit(1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue