* Re: [Qemu-devel] [libvirt] QEMU 1.6 and drive discard parameter [not found] ` <52720FB3.30202@redhat.com> @ 2013-10-31 8:35 ` Amos Kong 2013-10-31 11:17 ` Amos Kong 0 siblings, 1 reply; 3+ messages in thread From: Amos Kong @ 2013-10-31 8:35 UTC (permalink / raw) To: Osier Yang; +Cc: libvir-list, whitearchey, qemu-devel On Thu, Oct 31, 2013 at 04:07:15PM +0800, Osier Yang wrote: > CC to Amos. > > On 30/10/13 16:19, whitearchey wrote: > > > >In QEMU 1.6 parameters of 'drive' option were removed: > > > >QemuOptsList qemu_drive_opts = { > > .name = "drive", > > .head = QTAILQ_HEAD_INITIALIZER(qemu_drive_opts.head), > > .desc = { > > /* > > * no elements => accept any params > > * validation will happen later > > */ > > { /* end of list */ } > > }, > >}; > > > >But libvirt still checks for QEMU_CAPS_DRIVE_DISCARD using QMP > >query-command-line-options: > > > >static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = { > > { "machine", "mem-merge", QEMU_CAPS_MEM_MERGE }, > > { "drive", "discard", QEMU_CAPS_DRIVE_DISCARD }, > > { "realtime", "mlock", QEMU_CAPS_MLOCK }, > >}; > >... > >qemuMonitorGetCommandLineOptionParameters(mon, > >virQEMUCapsCommandLine[i].option, &values) > > > >So, when I try to use discard option in domain xml I get this error: > > > >error : qemuBuildDriveStr:3986 : unsupported configuration: > >discard is not supported by this QEMU binary > > > > It's a qemu problem, the command "query-command-line-options" should > keep working > after the structures were changed for any option, in this case, all > the option descs were > moved to "qemu_common_drive_opts" instead. { 'execute': 'query-command-line-options', 'arguments': { 'option': 'drive' } } { "return": [ { "parameters": [ ], "option": "drive" } ] } It returns a NULL parameters list, that's true, some error handling should be done by libvirt. > Regards, > Osier -- Amos. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [libvirt] QEMU 1.6 and drive discard parameter 2013-10-31 8:35 ` [Qemu-devel] [libvirt] QEMU 1.6 and drive discard parameter Amos Kong @ 2013-10-31 11:17 ` Amos Kong 0 siblings, 0 replies; 3+ messages in thread From: Amos Kong @ 2013-10-31 11:17 UTC (permalink / raw) To: Osier Yang Cc: Kevin Wolf, libvir-list, whitearchey, qemu-devel, Paolo Bonzini CC Kevin, Paolo On Thu, Oct 31, 2013 at 04:35:43PM +0800, Amos Kong wrote: > On Thu, Oct 31, 2013 at 04:07:15PM +0800, Osier Yang wrote: > > CC to Amos. > > > > On 30/10/13 16:19, whitearchey wrote: > > > > > >In QEMU 1.6 parameters of 'drive' option were removed: > > > > > >QemuOptsList qemu_drive_opts = { > > > .name = "drive", > > > .head = QTAILQ_HEAD_INITIALIZER(qemu_drive_opts.head), > > > .desc = { > > > /* > > > * no elements => accept any params > > > * validation will happen later > > > */ > > > { /* end of list */ } > > > }, > > >}; > > > > > >But libvirt still checks for QEMU_CAPS_DRIVE_DISCARD using QMP > > >query-command-line-options: > > > > > >static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = { > > > { "machine", "mem-merge", QEMU_CAPS_MEM_MERGE }, > > > { "drive", "discard", QEMU_CAPS_DRIVE_DISCARD }, > > > { "realtime", "mlock", QEMU_CAPS_MLOCK }, > > >}; > > >... > > >qemuMonitorGetCommandLineOptionParameters(mon, > > >virQEMUCapsCommandLine[i].option, &values) > > > > > >So, when I try to use discard option in domain xml I get this error: > > > > > >error : qemuBuildDriveStr:3986 : unsupported configuration: > > >discard is not supported by this QEMU binary > > > > > > > It's a qemu problem, the command "query-command-line-options" should > > keep working > > after the structures were changed for any option, in this case, all > > the option descs were > > moved to "qemu_common_drive_opts" instead. > > { 'execute': 'query-command-line-options', 'arguments': { 'option': 'drive' } } > > { > "return": [ > { > "parameters": [ > ], > "option": "drive" > } > ] > } > > It returns a NULL parameters list, that's true, some error handling > should be done by libvirt. Currently we have three QemuOptsList (qemu_common_drive_opts, qemu_legacy_drive_opts, and qemu_drive_opts) only qemu_drive_opts is added to vm_config_groups[] | commit 492fdc6fbe17b2d45878e813e980f782ac260c30 | Author: Kevin Wolf <kwolf@redhat.com> | Date: Wed Jun 19 13:44:17 2013 +0200 | | Revert "block: Disable driver-specific options for 1.5" This patch removed the items in qemu_drive_opts .desc We query commandline options by checking information in vm_config_groups[], so we can only get a NULL parameter list now. Another issue is we also can't query legacy options of -drive. -- Can we fix this problem by copy desc items of qemu_legacy_drive_opts and qemu_common_drive_opts to qemu_drive_opts? -- Amos. ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH 0/6] qapi: generate event defines automatically @ 2013-10-21 2:15 Wenchao Xia 2013-10-21 2:16 ` [Qemu-devel] [PATCH 2/6] qapi: rename MonitorEvent to QEvent Wenchao Xia 0 siblings, 1 reply; 3+ messages in thread From: Wenchao Xia @ 2013-10-21 2:15 UTC (permalink / raw) To: qemu-devel; +Cc: kwolf, armbru, lcapitulino, stefanha, pbonzini, Wenchao Xia This series move the event define to qapi code, so later other components could use it easily, it also make monitor code less and easier to decouple with other code. Original patch comes from my series titles as [PATCH 00/13] trivial patches for event, error and monitor To focus more on one item, pick up the event patches alone. patch 6 was not merged to 4 since doc may be a bit much, so make it separate to focus on doc's correctness. Note: please pay a bit attention on patch 6's doc for shutdown, powerdown, stop, resume, suspend, suspend_disk, wakeup, to see if it is correct. I paid some time to find the difference, and doced it from my understanding. Esp shutdown and powerdown is not very clear, from qemu online doc it says shutdown is gracefully operation and powerdown is brutely one, but the code shows shutdown event is generated when qemu get signal from "kill", which is correct? I hope to state those clearly in the doc, so I would be appreciate if you have comments on the doc. Wenchao Xia (6): 1 block: use type MonitorEvent directly 2 qapi: rename MonitorEvent to QEvent 3 qapi: rename prefix QEVENT to Q_EVENT 4 qapi: move event defines to qapi-schema.json 5 qapi: remove var monitor_event_names[] 6 qapi: add doc for QEvent balloon.c | 2 +- block.c | 6 +- block/qcow2-refcount.c | 2 +- blockdev.c | 4 +- blockjob.c | 5 +- cpus.c | 2 +- hw/acpi/core.c | 2 +- hw/core/qdev.c | 2 +- hw/misc/pvpanic.c | 2 +- hw/net/virtio-net.c | 2 +- hw/watchdog/watchdog.c | 2 +- include/block/block_int.h | 2 +- include/monitor/monitor.h | 39 +------------------ monitor.c | 64 ++++++++---------------------- qapi-schema.json | 93 ++++++++++++++++++++++++++++++++++++++++++++ stubs/mon-protocol-event.c | 2 +- target-s390x/kvm.c | 2 +- ui/spice-core.c | 8 ++-- ui/vnc.c | 8 ++-- vl.c | 14 +++--- 20 files changed, 144 insertions(+), 119 deletions(-) ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH 2/6] qapi: rename MonitorEvent to QEvent 2013-10-21 2:15 [Qemu-devel] [PATCH 0/6] qapi: generate event defines automatically Wenchao Xia @ 2013-10-21 2:16 ` Wenchao Xia 2013-11-01 14:02 ` Luiz Capitulino 0 siblings, 1 reply; 3+ messages in thread From: Wenchao Xia @ 2013-10-21 2:16 UTC (permalink / raw) To: qemu-devel; +Cc: kwolf, armbru, lcapitulino, stefanha, pbonzini, Wenchao Xia Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> --- block.c | 2 +- include/block/block_int.h | 2 +- include/monitor/monitor.h | 6 +++--- monitor.c | 12 ++++++------ stubs/mon-protocol-event.c | 2 +- ui/vnc.c | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/block.c b/block.c index 2c15e5d..458a4f8 100644 --- a/block.c +++ b/block.c @@ -1760,7 +1760,7 @@ void bdrv_set_dev_ops(BlockDriverState *bs, const BlockDevOps *ops, } void bdrv_emit_qmp_error_event(const BlockDriverState *bdrv, - MonitorEvent ev, + QEvent ev, BlockErrorAction action, bool is_read) { QObject *data; diff --git a/include/block/block_int.h b/include/block/block_int.h index bcc72e2..bfdaf84 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -337,7 +337,7 @@ AioContext *bdrv_get_aio_context(BlockDriverState *bs); int is_windows_drive(const char *filename); #endif void bdrv_emit_qmp_error_event(const BlockDriverState *bdrv, - MonitorEvent ev, + QEvent ev, BlockErrorAction action, bool is_read); /** diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 10fa0e3..8b14a6f 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -20,7 +20,7 @@ extern Monitor *default_mon; #define MONITOR_CMD_ASYNC 0x0001 /* QMP events */ -typedef enum MonitorEvent { +typedef enum QEvent { QEVENT_SHUTDOWN, QEVENT_RESET, QEVENT_POWERDOWN, @@ -54,11 +54,11 @@ typedef enum MonitorEvent { * defining new events here */ QEVENT_MAX, -} MonitorEvent; +} QEvent; int monitor_cur_is_qmp(void); -void monitor_protocol_event(MonitorEvent event, QObject *data); +void monitor_protocol_event(QEvent event, QObject *data); void monitor_init(CharDriverState *chr, int flags); int monitor_suspend(Monitor *mon); diff --git a/monitor.c b/monitor.c index 74f3f1b..9377834 100644 --- a/monitor.c +++ b/monitor.c @@ -175,7 +175,7 @@ typedef struct MonitorControl { * instance. */ typedef struct MonitorEventState { - MonitorEvent event; /* Event being tracked */ + QEvent event; /* Event being tracked */ int64_t rate; /* Period over which to throttle. 0 to disable */ int64_t last; /* Time at which event was last emitted */ QEMUTimer *timer; /* Timer for handling delayed events */ @@ -517,7 +517,7 @@ QemuMutex monitor_event_state_lock; * Emits the event to every monitor instance */ static void -monitor_protocol_event_emit(MonitorEvent event, +monitor_protocol_event_emit(QEvent event, QObject *data) { Monitor *mon; @@ -536,7 +536,7 @@ monitor_protocol_event_emit(MonitorEvent event, * applying any rate limiting if required. */ static void -monitor_protocol_event_queue(MonitorEvent event, +monitor_protocol_event_queue(QEvent event, QObject *data) { MonitorEventState *evstate; @@ -614,7 +614,7 @@ static void monitor_protocol_event_handler(void *opaque) * milliseconds */ static void -monitor_protocol_event_throttle(MonitorEvent event, +monitor_protocol_event_throttle(QEvent event, int64_t rate) { MonitorEventState *evstate; @@ -650,7 +650,7 @@ static void monitor_protocol_event_init(void) * * Event-specific data can be emitted through the (optional) 'data' parameter. */ -void monitor_protocol_event(MonitorEvent event, QObject *data) +void monitor_protocol_event(QEvent event, QObject *data) { QDict *qmp; const char *event_name; @@ -1067,7 +1067,7 @@ CommandInfoList *qmp_query_commands(Error **errp) EventInfoList *qmp_query_events(Error **errp) { EventInfoList *info, *ev_list = NULL; - MonitorEvent e; + QEvent e; for (e = 0 ; e < QEVENT_MAX ; e++) { const char *event_name = monitor_event_names[e]; diff --git a/stubs/mon-protocol-event.c b/stubs/mon-protocol-event.c index 0946e94..e769729 100644 --- a/stubs/mon-protocol-event.c +++ b/stubs/mon-protocol-event.c @@ -1,6 +1,6 @@ #include "qemu-common.h" #include "monitor/monitor.h" -void monitor_protocol_event(MonitorEvent event, QObject *data) +void monitor_protocol_event(QEvent event, QObject *data) { } diff --git a/ui/vnc.c b/ui/vnc.c index 5601cc3..47fda54 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -275,7 +275,7 @@ static void vnc_client_cache_addr(VncState *client) client->info = QOBJECT(qdict); } -static void vnc_qmp_event(VncState *vs, MonitorEvent event) +static void vnc_qmp_event(VncState *vs, QEvent event) { QDict *server; QObject *data; -- 1.7.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 2/6] qapi: rename MonitorEvent to QEvent 2013-10-21 2:16 ` [Qemu-devel] [PATCH 2/6] qapi: rename MonitorEvent to QEvent Wenchao Xia @ 2013-11-01 14:02 ` Luiz Capitulino 2013-11-01 14:21 ` [Qemu-devel] [libvirt] QEMU 1.6 and drive discard parameter Gareth Bult 0 siblings, 1 reply; 3+ messages in thread From: Luiz Capitulino @ 2013-11-01 14:02 UTC (permalink / raw) To: Wenchao Xia; +Cc: kwolf, qemu-devel, armbru, stefanha, pbonzini On Mon, 21 Oct 2013 10:16:01 +0800 Wenchao Xia <xiawenc@linux.vnet.ibm.com> wrote: > Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> > --- > block.c | 2 +- > include/block/block_int.h | 2 +- > include/monitor/monitor.h | 6 +++--- > monitor.c | 12 ++++++------ > stubs/mon-protocol-event.c | 2 +- > ui/vnc.c | 2 +- > 6 files changed, 13 insertions(+), 13 deletions(-) > > diff --git a/block.c b/block.c > index 2c15e5d..458a4f8 100644 > --- a/block.c > +++ b/block.c > @@ -1760,7 +1760,7 @@ void bdrv_set_dev_ops(BlockDriverState *bs, const BlockDevOps *ops, > } > > void bdrv_emit_qmp_error_event(const BlockDriverState *bdrv, > - MonitorEvent ev, > + QEvent ev, > BlockErrorAction action, bool is_read) > { > QObject *data; > diff --git a/include/block/block_int.h b/include/block/block_int.h > index bcc72e2..bfdaf84 100644 > --- a/include/block/block_int.h > +++ b/include/block/block_int.h > @@ -337,7 +337,7 @@ AioContext *bdrv_get_aio_context(BlockDriverState *bs); > int is_windows_drive(const char *filename); > #endif > void bdrv_emit_qmp_error_event(const BlockDriverState *bdrv, > - MonitorEvent ev, > + QEvent ev, > BlockErrorAction action, bool is_read); > > /** > diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h > index 10fa0e3..8b14a6f 100644 > --- a/include/monitor/monitor.h > +++ b/include/monitor/monitor.h > @@ -20,7 +20,7 @@ extern Monitor *default_mon; > #define MONITOR_CMD_ASYNC 0x0001 > > /* QMP events */ > -typedef enum MonitorEvent { > +typedef enum QEvent { Qt has a QEvent class, so QEvent is not a good name for us if we're considering making it public in the schema (which could become an external library in the distant future). I suggest calling it QMPEvent. > QEVENT_SHUTDOWN, > QEVENT_RESET, > QEVENT_POWERDOWN, > @@ -54,11 +54,11 @@ typedef enum MonitorEvent { > * defining new events here */ > > QEVENT_MAX, > -} MonitorEvent; > +} QEvent; > > int monitor_cur_is_qmp(void); > > -void monitor_protocol_event(MonitorEvent event, QObject *data); > +void monitor_protocol_event(QEvent event, QObject *data); > void monitor_init(CharDriverState *chr, int flags); > > int monitor_suspend(Monitor *mon); > diff --git a/monitor.c b/monitor.c > index 74f3f1b..9377834 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -175,7 +175,7 @@ typedef struct MonitorControl { > * instance. > */ > typedef struct MonitorEventState { > - MonitorEvent event; /* Event being tracked */ > + QEvent event; /* Event being tracked */ > int64_t rate; /* Period over which to throttle. 0 to disable */ > int64_t last; /* Time at which event was last emitted */ > QEMUTimer *timer; /* Timer for handling delayed events */ > @@ -517,7 +517,7 @@ QemuMutex monitor_event_state_lock; > * Emits the event to every monitor instance > */ > static void > -monitor_protocol_event_emit(MonitorEvent event, > +monitor_protocol_event_emit(QEvent event, > QObject *data) > { > Monitor *mon; > @@ -536,7 +536,7 @@ monitor_protocol_event_emit(MonitorEvent event, > * applying any rate limiting if required. > */ > static void > -monitor_protocol_event_queue(MonitorEvent event, > +monitor_protocol_event_queue(QEvent event, > QObject *data) > { > MonitorEventState *evstate; > @@ -614,7 +614,7 @@ static void monitor_protocol_event_handler(void *opaque) > * milliseconds > */ > static void > -monitor_protocol_event_throttle(MonitorEvent event, > +monitor_protocol_event_throttle(QEvent event, > int64_t rate) > { > MonitorEventState *evstate; > @@ -650,7 +650,7 @@ static void monitor_protocol_event_init(void) > * > * Event-specific data can be emitted through the (optional) 'data' parameter. > */ > -void monitor_protocol_event(MonitorEvent event, QObject *data) > +void monitor_protocol_event(QEvent event, QObject *data) > { > QDict *qmp; > const char *event_name; > @@ -1067,7 +1067,7 @@ CommandInfoList *qmp_query_commands(Error **errp) > EventInfoList *qmp_query_events(Error **errp) > { > EventInfoList *info, *ev_list = NULL; > - MonitorEvent e; > + QEvent e; > > for (e = 0 ; e < QEVENT_MAX ; e++) { > const char *event_name = monitor_event_names[e]; > diff --git a/stubs/mon-protocol-event.c b/stubs/mon-protocol-event.c > index 0946e94..e769729 100644 > --- a/stubs/mon-protocol-event.c > +++ b/stubs/mon-protocol-event.c > @@ -1,6 +1,6 @@ > #include "qemu-common.h" > #include "monitor/monitor.h" > > -void monitor_protocol_event(MonitorEvent event, QObject *data) > +void monitor_protocol_event(QEvent event, QObject *data) > { > } > diff --git a/ui/vnc.c b/ui/vnc.c > index 5601cc3..47fda54 100644 > --- a/ui/vnc.c > +++ b/ui/vnc.c > @@ -275,7 +275,7 @@ static void vnc_client_cache_addr(VncState *client) > client->info = QOBJECT(qdict); > } > > -static void vnc_qmp_event(VncState *vs, MonitorEvent event) > +static void vnc_qmp_event(VncState *vs, QEvent event) > { > QDict *server; > QObject *data; ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [libvirt] QEMU 1.6 and drive discard parameter 2013-11-01 14:02 ` Luiz Capitulino @ 2013-11-01 14:21 ` Gareth Bult 0 siblings, 0 replies; 3+ messages in thread From: Gareth Bult @ 2013-11-01 14:21 UTC (permalink / raw) To: qemu-devel Hey guys, I've just rolled out Qemu 1.6 to fix problems I've been having, which worked fine .. but I've now lost discard support which is a problem. Is there an easy / quick fix for this without digging through other people's code? I'm happy to compile up whatever is necessary, I just need the "discard" option to work for Libvirt / Qemu 1.6 ... tia Gareth. On Thu, Oct 31, 2013 at 04:35:43PM +0800, Amos Kong wrote: > On Thu, Oct 31, 2013 at 04:07:15PM +0800, Osier Yang wrote: > > CC to Amos. > > > > On 30/10/13 16:19, whitearchey wrote: > > > > > >In QEMU 1.6 parameters of 'drive' option were removed: > > > > > >QemuOptsList qemu_drive_opts = { > > > .name = "drive", > > > .head = QTAILQ_HEAD_INITIALIZER(qemu_drive_opts.head), > > > .desc = { > > > /* > > > * no elements => accept any params > > > * validation will happen later > > > */ > > > { /* end of list */ } > > > }, > > >}; > > > > > >But libvirt still checks for QEMU_CAPS_DRIVE_DISCARD using QMP > > >query-command-line-options: > > > > > >static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = { > > > { "machine", "mem-merge", QEMU_CAPS_MEM_MERGE }, > > > { "drive", "discard", QEMU_CAPS_DRIVE_DISCARD }, > > > { "realtime", "mlock", QEMU_CAPS_MLOCK }, > > >}; > > >... > > >qemuMonitorGetCommandLineOptionParameters(mon, > > >virQEMUCapsCommandLine[i].option, &values) > > > > > >So, when I try to use discard option in domain xml I get this error: > > > > > >error : qemuBuildDriveStr:3986 : unsupported configuration: > > >discard is not supported by this QEMU binary > > > > > > > It's a qemu problem, the command "query-command-line-options" should > > keep working > > after the structures were changed for any option, in this case, all > > the option descs were > > moved to "qemu_common_drive_opts" instead. > > { 'execute': 'query-command-line-options', 'arguments': { 'option': 'drive' } > } > > { > "return": [ > { > "parameters": [ > ], > "option": "drive" > } > ] > } > > It returns a NULL parameters list, that's true, some error handling > should be done by libvirt. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-01 14:10 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <op.w5rdfdurcb68cn@whitewind-arch> [not found] ` <52720FB3.30202@redhat.com> 2013-10-31 8:35 ` [Qemu-devel] [libvirt] QEMU 1.6 and drive discard parameter Amos Kong 2013-10-31 11:17 ` Amos Kong 2013-10-21 2:15 [Qemu-devel] [PATCH 0/6] qapi: generate event defines automatically Wenchao Xia 2013-10-21 2:16 ` [Qemu-devel] [PATCH 2/6] qapi: rename MonitorEvent to QEvent Wenchao Xia 2013-11-01 14:02 ` Luiz Capitulino 2013-11-01 14:21 ` [Qemu-devel] [libvirt] QEMU 1.6 and drive discard parameter Gareth Bult
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).