From: Ashijeet Acharya <ashijeetacharya@gmail.com>
To: dgilbert@redhat.com
Cc: quintela@redhat.com, amit.shah@redhat.com, qemu-devel@nongnu.org,
Ashijeet Acharya <ashijeetacharya@gmail.com>
Subject: [Qemu-devel] [PATCH] migrate: Introduce a 'dc->vmsd' check to avoid segfault for --only-migratable
Date: Mon, 30 Jan 2017 20:11:11 +0530 [thread overview]
Message-ID: <1485787271-8754-1-git-send-email-ashijeetacharya@gmail.com> (raw)
Commit a3a3d8c7 introduced a segfault bug while checking for
'dc->vmsd->unmigratable' which caused QEMU to crash when trying to add
devices which do no set their 'dc->vmsd' yet while initialization.
Place a 'dc->vmsd' check prior to it so that we do not segfault for
such devices.
NOTE: This doesn't compromise the functioning of --only-migratable
option as all the unmigratable devices do set their 'dc->vmsd'.
Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com>
---
qdev-monitor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 81d01df..a1106fd 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -578,7 +578,7 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp)
return NULL;
}
- if (only_migratable) {
+ if (only_migratable && dc->vmsd) {
if (dc->vmsd->unmigratable) {
error_setg(errp, "Device %s is not migratable, but "
"--only-migratable was specified", driver);
--
2.6.2
next reply other threads:[~2017-01-30 14:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-30 14:41 Ashijeet Acharya [this message]
2017-01-30 15:09 ` [Qemu-devel] [PATCH] migrate: Introduce a 'dc->vmsd' check to avoid segfault for --only-migratable Peter Maydell
2017-01-30 16:38 ` Juan Quintela
2017-02-04 8:44 ` Ashijeet Acharya
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1485787271-8754-1-git-send-email-ashijeetacharya@gmail.com \
--to=ashijeetacharya@gmail.com \
--cc=amit.shah@redhat.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).