sorry for the delay.
you are best to go with your first thoughts although the second way would also work (but leave the out on the jv disconnected from the qy)
the first way is probably most straight forward.
out on m1 - in on QY
out on QY - in on M1
thru on M1- in on JV
then you will be able to play keys on the M1 keyboard and it will either trigger internal sounds from the qy, play itself, or play the JV depending on what track on the QY you have it set on. the QY will be recording all note info though in this setup and everything will be slaved to it so pressing play etc on this will let you hear your loops.
what you need to do is assign individual midi channel IDs to each piece (jv on 3, M1 on 2).
then as you make up patterns, pick a track on the QY from 1 to 16 and in the menu, assign a midi channel to it depending on what you want it to do.the default will be each track number has the same midi number, ie track 1 outputs on midi channel 1, track 9 on midi channel 9. if you want your percussion on tracks 1-8, (and i assume you are using internal voices from the QY for this) then switch off midi output (ie.0) on each of these and leave the internal tone generator channel at default ie 1-1, 2-2 etc.
then if you want the jv to do a bass line on say track 9,in the menu switch off internal TG channel and change midi output channel from 9 to 3. then make sure the qy is still on track nine, when you play the M1 keyboard it will play the JV (make sure you have the m1 volume down to save hearing both). once you have got something, record it. if you press play on the QY you will hear your rhythms and the bass line loop.
now repeat for any lines you want playing from the M1 or other notes from the JV by selecting the next track up, switching the internal tone generator send off, selecting the relevant midi channel and recording it.
if you want more synth lines or chords from the internal sounds on the QY, just remember to select a blank track and turn off the midi output. thsi should get you going fine. good luck