summaryrefslogtreecommitdiffstats
path: root/qerror.c
Commit message (Collapse)AuthorAgeFilesLines
* error, qerror: drop QDict memberLuiz Capitulino2012-08-131-4/+0
| | | | | | | Used to store error information, but it's unused now. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* qerror: drop qerror_table and qerror_format()Luiz Capitulino2012-08-131-400/+0
| | | | | | | They are unused since last commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* error, qerror: pass desc string to error callsLuiz Capitulino2012-08-131-41/+1
| | | | | | | | | | | | | | This commit changes all QERR_ macros to contain a human message (ie. the desc string found in qerr_table[]) instead of a json dictionary in string format. Before this commit, error_set() and qerror_report() would receive a json dictionary in string format and build a qobject from it. Now, both function receive a human message instead and the qobject is not built anymore. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* error, qerror: add ErrorClass argument to error functionsLuiz Capitulino2012-08-131-3/+7
| | | | | | | | | | | | | | | | The new argument is added to functions qerror_report() and error_set(). It's stored in Error and QError. qerror_report_err() is also updated to take care of it. The QERR_ macros are changed to contain a place holder value for the new argument, so that the value is used on all current calls to qerror_report() and error_set() (and also to initialize qerror_table[]). Next commit will update the QERR_ macros with a proper ErrorClass value. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* qerror: qerror_table: don't use C99 struct initializersLuiz Capitulino2012-08-131-138/+138
| | | | | | | | This allows for changing QERR_ macros to initialize two struct members at the same time. See next commit for more details. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* qerror: drop QERR_SOCKET_CONNECT_IN_PROGRESSLuiz Capitulino2012-08-131-4/+0
| | | | | | | Unused since last commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* error: don't delay error message constructionLuiz Capitulino2012-08-131-3/+1
| | | | | | | | | | | Today, the error message is only constructed when it's used. This commit changes that to construct the error message when the error object is built (ie. when the error is reported). This simplifies the Error object. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* qerror: don't delay error message constructionLuiz Capitulino2012-08-131-25/+4
| | | | | | | | | | | | Today, the error message is only constructed when it's used. This commit changes qerror to construct the error message when the error object is built (ie. when the error is reported). This eliminates the need of storing a pointer to qerror_table[], which will be dropped soon, and also simplifies the code. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* qerror: qerror_format(): return an allocated stringLuiz Capitulino2012-08-131-2/+8
| | | | | | | Simplifies current and future users. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* qerror: QError: drop file, linenr, funcLuiz Capitulino2012-08-131-17/+3
| | | | | | | | | | | They have never been fully used and conflict with future error improvements. Also makes qerror_report() a proper function, as there's no point in having it as a macro anymore. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* qerror: avoid passing qerr pointerLuiz Capitulino2012-08-131-12/+12
| | | | | | | Helps dropping/modifying qerror functions. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* qerror: drop qerror_abort()Luiz Capitulino2012-08-131-27/+14
| | | | | | | | | | qerror_abort() depends on the 'file', 'func' and 'linenr' members of QError. However, these members are going to be dropped by the next commit, so let's drop qerror_abort() in favor of printing an error message to stderr plus a call to abort(). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* qerror: reduce public exposureLuiz Capitulino2012-08-131-5/+5
| | | | | | | | qerror will be dropped in a near future, let's reduce its public exposure by making functions only used in qerror.c static. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* qerror: QERR_DEVICE_ENCRYPTED: change error messageLuiz Capitulino2012-08-131-1/+1
| | | | | | | Match what HMP commands print on DeviceEncrypted errors. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* qerror: QERR_AMBIGUOUS_PATH: drop %(object) from human msgLuiz Capitulino2012-08-131-1/+1
| | | | | | | | Actually, renames it to 'object'. This must be what the original author meant to write, as there's no 'object' in the error's data member. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* qerror: introduce QERR_INVALID_OPTION_GROUPLuiz Capitulino2012-06-041-0/+4
| | | | | Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-By: Laszlo Ersek <lersek@redhat.com>
* qerror: add five qerror stringsAmos Kong2012-05-101-0/+20
| | | | | | | | | | | | | | Add five new qerror strings, they are about listen/connect socket: QERR_SOCKET_CONNECT_IN_PROGRESS QERR_SOCKET_CONNECT_FAILED QERR_SOCKET_LISTEN_FAILED QERR_SOCKET_BIND_FAILED QERR_SOCKET_CREATE_FAILED Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: add blocksize property typeStefan Hajnoczi2012-04-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Storage interfaces like virtio-blk can be configured with block size information so that the guest can take advantage of efficient I/O request sizes. According to the SCSI Block Commands (SBC) standard a device's block size is "almost always greater than one byte and may be a multiple of 512 bytes". QEMU currently has a 512 byte minimum block size because the block layer functions work at that granularity. Furthermore, the block size should be a power of 2 because QEMU calculates bitmasks from the value. Introduce a "blocksize" property type so devices can enforce these constraints on block size values. If the constraints are relaxed in the future then this property can be updated. Introduce the new PropertyValueNotPowerOf2 QError so QMP clients know exactly why a block size value was rejected. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qerror: fix QERR_PROPERTY_VALUE_OUT_OF_RANGE descriptionStefan Hajnoczi2012-04-051-1/+1
| | | | | | | | | Fix a typo in the description for QERR_PROPERTY_VALUE_OUT_OF_RANGE where "'" was used instead of ")". Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* QError: Introduce new errors for the migration commandLuiz Capitulino2012-03-151-0/+8
| | | | | | | The new errors are QERR_MIGRATION_ACTIVE and QERR_MIGRATION_NOT_SUPPORTED, which are going to be used by the QAPI converted migration command. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qdev: print error message before abortingPaolo Bonzini2012-02-141-0/+8
| | | | | | | | | qdev_prop_set_* functions are always called by machine init functions that should know what they're doing, so they abort on error. Still, an assert(!errp) does not aid debugging. Print an error before aborting. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qom: use object_resolve_path_type for linksPaolo Bonzini2012-02-071-0/+4
| | | | | | | | | | | | | | | This allows to restrict partial matches to objects of the expected type. It will let people use bare names to reference drives even though their name might be the same as a device's (e.g. -drive id=hd0,if=none,... -device ...,drive=hd0,id=hd0). As a useful byproduct, this fixes a problem with links of interface type. When a link property's type is an interface, the code expects the implementation object (not the parent object) to be stored in the variable. The parent object does not contain the right vtable. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qom: add new command to search for typesAnthony Liguori2012-02-031-1/+1
| | | | | | | | | | | | | | | This adds a command that allows searching for types that implement a property. This allows you to do things like search for all available PCIDevices. In the future, we'll also have a standard interface for things with a BlockDriverState property that a PCIDevice could implement. This will enable search queries like, "any type that implements the BlockDevice interface" which would allow management tools to present available block devices without having to hard code device names. Since an object can implement multiple interfaces, one device could act both as a BlockDevice and a NetworkDevice. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add QERR_BASE_NOT_FOUNDMarcelo Tosatti2012-01-261-0/+4
| | | | | | | | | | This qerror will be raised when a given streaming base (backing file) cannot be found. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qmp: add block_stream commandStefan Hajnoczi2012-01-261-0/+4
| | | | | | | | | | | | Add the block_stream command, which starts copy backing file contents into the image file. Also add the BLOCK_JOB_COMPLETED QMP event which is emitted when image streaming completes. Later patches add control over the background copy speed, cancelation, and querying running streaming operations. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: use proper qerrors in qmp_block_resizeStefan Hajnoczi2012-01-181-0/+8
| | | | | | | | | | | | Let's report specific errors so that management tools and users can identify the problem. Two new qerrors are needed: * QERR_DEVICE_HAS_NO_MEDIUM for ENOMEDIUM * QERR_DEVICE_IS_READ_ONLY for EACCES Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qerror: restore alphabetical order over qerrorsStefan Hajnoczi2012-01-181-42/+42
| | | | | | | | | | Over time these must have gotten out of order. Put everything back in alphabetical order. This is purely a clean up. In practice nothing depends on the order. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qerror: add check-qerror.sh to verify alphabetical orderStefan Hajnoczi2012-01-181-2/+1
| | | | | | | | | | | | We're supposed to keep qerror definitions and table entries in alphabetical order. In practice this is not checked. I haven't found a nice way to integrate this into the makefile yet but we can at least have this script which verifies that qerrors are in alphabetical order. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qom: introduce QERR_PROPERTY_VALUE_OUT_OF_RANGEPaolo Bonzini2011-12-191-0/+5
| | | | | | | | | This will be used when reject invalid values for integer fields that are less than 64-bits wide. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qom: add new dynamic property infrastructure based on Visitors (v2)Anthony Liguori2011-12-151-0/+4
| | | | | | | | | | | qdev properties are settable only during construction and static to classes. This isn't flexible enough for QOM. This patch introduces a property interface for qdev that provides dynamic properties that are tied to objects, instead of classes. These properties are Visitor based instead of string based too. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'stefanha/trivial-patches-next' into stagingAnthony Liguori2011-12-141-1/+1
|\
| * Fix spelling in comments, documentation and messagesStefan Weil2011-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | accidently->accidentally annother->another choosen->chosen consideres->considers decriptor->descriptor developement->development paramter->parameter preceed->precede preceeding->preceding priviledge->privilege propogation->propagation substraction->subtraction throught->through upto->up to usefull->useful Fix also grammar in posix-aio-compat.c Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | guest agent: add RPC blacklist command-line optionMichael Roth2011-12-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a command-line option, -b/--blacklist, that accepts a comma-seperated list of RPCs to disable, or prints a list of available RPCs if passed "?". In consequence this also adds general blacklisting and RPC listing facilities to the new QMP dispatch/registry facilities, should the QMP monitor ever have a need for such a thing. Ideally, to avoid support/compatability issues in the future, blacklisting guest agent functionality will be the exceptional case, but we add the functionality here to handle guest administrators with specific requirements. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | QError: Introduce QERR_IO_ERRORLuiz Capitulino2011-12-061-0/+4
|/ | | | Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2011-12-051-0/+4
|\
| * hmp/qmp: add block_set_io_throttleZhi Yong Wu2011-12-051-0/+4
| | | | | | | | | | | | Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | Merge remote-tracking branch 'aneesh/1.0-fixes' into stagingAnthony Liguori2011-12-051-0/+5
|\ \
| * | hw/9pfs: use migration blockers to prevent live migration when virtfs export ↵Aneesh Kumar K.V2011-12-041-0/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | path is mounted Now when you try to migrate with VirtFS export path mounted, you get a proper QMP error: (qemu) migrate tcp:localhost:4444 Migration is disabled when VirtFS export path '/tmp/' is mounted in the guest using mount_tag 'v_tmp' (qemu) Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
* | fix spelling in main directoryDong Xu Wang2011-12-021-1/+1
|/ | | | | Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* qed: add migration blocker (v2)Anthony Liguori2011-11-211-0/+4
| | | | | | | | | | Now when you try to migrate with qed, you get: (qemu) migrate tcp:localhost:1025 Block format 'qed' used by device 'ide0-hd0' does not support feature 'live migration' (qemu) Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ivshmem: use migration blockers to prevent live migration in peer mode (v2)Anthony Liguori2011-11-211-0/+4
| | | | | | | | | | Now when you try to migrate with ivshmem, you get a proper QMP error: (qemu) migrate tcp:localhost:1025 Migration is disabled when using feature 'peer mode' in device 'ivshmem' (qemu) Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qerror: Add a user string for QERR_FEATURE_DISABLEDLuiz Capitulino2011-10-271-0/+4
| | | | | | Missing from commit 821601ea5b. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qerror: add qerror_report_err()Anthony Liguori2011-10-041-0/+33
| | | | | | | | | | | This provides a bridge between Error (new error mechanism) and QError (old error mechanism). Errors can be propagated whereas QError cannot. The minor evilness avoids layering violations. Since QError should go away RSN, it seems like a reasonable hack. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Monitor/QMP: Don't allow cont on bad VM stateLuiz Capitulino2011-09-151-0/+4
| | | | | | | | | | | | | | We have two states where issuing cont before system_reset can cause problems: RSTATE_SHUTDOWN (when -no-shutdown is used) and RSTATE_PANICKED (which only happens with kvm). This commit fixes that by doing the following when state is RSTATE_SHUTDOWN or RSTATE_PANICKED: 1. returning an error to the user/client if cont is issued 2. automatically transition to RSTATE_PAUSED during system_reset Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Use glib memory allocation and free functionsAnthony Liguori2011-08-201-2/+2
| | | | | | qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Introduce a 'client_add' monitor command accepting an open FDDaniel P. Berrange2011-07-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow client connections for VNC and socket based character devices to be passed in over the monitor using SCM_RIGHTS. One intended usage scenario is to start QEMU with VNC on a UNIX domain socket. An unprivileged user which cannot access the UNIX domain socket, can then connect to QEMU's VNC server by passing an open FD to libvirt, which passes it onto QEMU. { "execute": "get_fd", "arguments": { "fdname": "myclient" } } { "return": {} } { "execute": "add_client", "arguments": { "protocol": "vnc", "fdname": "myclient", "skipauth": true } } { "return": {} } In this case 'protocol' can be 'vnc' or 'spice', or the name of a character device (eg from -chardev id=XXXX) The 'skipauth' parameter can be used to skip any configured VNC authentication scheme, which is useful if the mgmt layer talking to the monitor has already authenticated the client in another way. * console.h: Define 'vnc_display_add_client' method * monitor.c: Implement 'client_add' command * qemu-char.c, qemu-char.h: Add 'qemu_char_add_client' method * qerror.c, qerror.h: Add QERR_ADD_CLIENT_FAILED * qmp-commands.hx: Declare 'client_add' command * ui/vnc.c: Implement 'vnc_display_add_client' method Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* guest agent: add guest agent RPCs/commandsMichael Roth2011-07-211-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the initial set of QMP/QAPI commands provided by the guest agent: guest-sync guest-ping guest-info guest-shutdown guest-file-open guest-file-read guest-file-write guest-file-seek guest-file-flush guest-file-close guest-fsfreeze-freeze guest-fsfreeze-thaw guest-fsfreeze-status The input/output specification for these commands are documented in the schema. Example usage: host: qemu -device virtio-serial \ -chardev socket,path=/tmp/vs0.sock,server,nowait,id=qga0 \ -device virtserialport,chardev=qga0,name=org.qemu.quest_agent.0 ... echo "{'execute':'guest-info'}" | socat stdio unix-connect:/tmp/qga0.sock guest: qemu-ga -m virtio-serial -p /dev/virtio-ports/org.qemu.guest_agent.0 \ -p /var/run/qemu-guest-agent.pid -d Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
* qerror: add QERR_JSON_PARSE_ERROR to qerror.cMichael Roth2011-07-211-0/+5
| | | | | | | | Missing from previous addition of error to qerror.h. Needed for qerror_format() and friends. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
* Merge remote-tracking branch 'qmp/for-anthony' into stagingAnthony Liguori2011-06-081-0/+4
|\
| * QMP: QError: New QERR_UNSUPPORTEDLai Jiangshan2011-06-011-0/+4
| | | | | | | | | | | | New QERR_UNSUPPORTED for unsupported commands or requests. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
OpenPOWER on IntegriCloud