On Tue, 2016-11-22 at 18:24 +0100, Paolo Bonzini wrote:
>
> On 22/11/2016 18:22, Cédric Le Goater wrote:
> >
> > >
> > > +
> > > + g_assert(words[1]); /* device */
> > > + g_assert(words[2]); /* gpio list */
> > > + g_assert(words[3]); /* gpio line in list */
> > > + g_assert(words[4]); /* level */
> > > + dev = DEVICE(object_resolve_path(words[1], NULL));
> > > + if (!dev) {
> > > + qtest_send_prefix(chr);
> > > + qtest_send(chr, "FAIL Unknown device\n");
> > > + return;
> > > + }
> > > +
> > > + irq_num = atoi(words[3]);
> > > + level = atoi(words[4]);
> > > +
> > > + QLIST_FOREACH(ngl, &dev->gpios, node) {
> > > + if (strcmp(words[2], ngl->name) == 0 && ngl->num_in
> > > > irq_num) {
> > > + irq = ngl->in[irq_num];
> > > + }
> > > + }
> > > +
> > > + if (irq == NULL) {
> > > + qtest_send_prefix(chr);
> > > + qtest_send(chr, "FAIL Unknown IRQ\n");
> > > + return;
> > > + }
> > > +
> > > + qemu_set_irq(irq, level);
>
> This seems wrong. The IRQ should not be modifiable by the test.
>
> Paolo
>
Thanks Paolo, could you please advise as to why that is?
The situation I am addressing is that I device under test that changes
behaviour when a GPIO line is raised. Is there another way I should be
raising that line from within qtest?
--
Alastair D'Silva
Open Source Developer
Linux Technology Centre, IBM Australia
mob: 0423 762 819